You can view the tutorials best in Google Chrome, Mozilla Firefox, Opera, higher version of Internet Explorer

Struts2 Insert,Update,Delete,Operations Through JDBC [ Real Time Application ]

Struts » On Feb 1, 2012 By Sivateja

Let us see  on how to work with Insert,Update,Delete operations through struts 2 with JDBC connect, a real time application.  Even we will see the same application using Struts 2 and Hibernate.

Actually i have not covered example on ServletRequestAware, ServletResponseAware Interface(s) earlier,  but its time to use these interfaces too :-).  Yeah i have used these interfaces in this program.


Directory Structure

Files Required

  • web.xml
  • struts.xml
  • dsuccess.jsp
  • edit.jsp
  • error.jsp
  • index.jsp
  • retrive.jsp
  • ssuccess.jsp
  • usuccess.jsp












By ( Java/J2EE Developer & Web Designer )
Founder of You can contact me at sivateja [at]


18 Responses to “Struts2 Insert,Update,Delete,Operations Through JDBC [ Real Time Application ]”
  1. Anirban Chakraborty says:

    In the example STRUTS-JDBC-CRUD in every action you write the JDBC code.
    Please write the JDBC code separately & call the methods in ACTION & also upload the code as soon as possible.

  2. suhel Mulla says:

    I don’t get the “struts-tags” file from your code…..
    please help me.

  3. Java4s says:

    @suhel Mulla

    You no need to add separately :-)

  4. parivallal says:

    I don’t get the “struts-tags” file from your code…..
    please help me.

  5. Java4s says:


    We no more need to add any external struts-tags in 2.x :-)

  6. Pushker says:

    you should use custom tag in JSP page and use a separate class for the connection

  7. preeti says:

    Can you Please give this code in war file.

  8. Sameer says:

    Really Nice Example. Thanks you so much.If you have some other examples plaese share.

  9. Manoj says:

    Hi sir i am new in struts2, i want to display all records in tabular format including Edit button ; When user click on that edit button the open new form in that all details will be displayed and that user will be edit that particuler record only please give me that code..
    Thanks in advance…

  10. Sanjeev K says:

    I have trying to develop“Struts2 Insert,Update,Delete,Operations Through JDBC, Everything i configure correctly but i didn’t get a pre-defined classes or methods while developing progm Pls help me.

  11. JavaTrainee says:

    Hey great article.
    Can you please post an article on the best practices for struts2+jdbc application cdrud operations?
    I read somewhere that it’s not a good practice to use ServletRequestAware for db connections. Please help

  12. rakesh says:

    you have to add jar files first, then “/struts-tags” will work…

  13. harsh says:

    can you provide me code for CRUD operation in struts2 using session as persistent technique and not database

  14. Anil says:

    Where did you fix the context path Struts-insert-edit-delete.

  15. Harendra says:

    to connect the jdbc jar file.

  16. Tanuj says:

    In above example my update action is not working . Number column is not working
    plz help…

  17. Soubhagya Padhi says:

    In the above example you used a map to populate data in update through sno..but what is that #application you used in edit.jsp,can you just explain me?


By posting your answer, you agree to our comments policy.
So, What would you like to learn today?
Browse these popular technologies
Hibernate spring struts Servlets ajax Log4j jQuery Json Core Java Web Services AngularJs

Most Recent Tutorials
Hibernate Recent Posts
Spring Recent Posts
Struts Recent Posts
Recomandded Links
Current & UpComing Tutorials
Sitemap :
spring Hibernate struts Json Ajax Log4j Log4j coreJava Servlets Web Services

  Web Services [ SOAP ], JSP
Facebook_Java4s  Twitter_Java4s  GooglePlus_Java4s  Youtube_Java4s 
© 2010 - 2015 Java4s - Get It Yourself.
The content is copyrighted to Sivateja Kandula and may not be reproduced on other websites.