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 | { 12 Comments }

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

  • Delete.java
  • Display.java
  • Links.java
  • Mybean.java
  • Save.java
  • Update.java
  • Updates.java
  • web.xml
  • struts.xml
  • dsuccess.jsp
  • edit.jsp
  • error.jsp
  • index.jsp
  • retrive.jsp
  • ssuccess.jsp
  • usuccess.jsp

Delete.java

Display.java

Links.java

Mybean.java

Save.java

Update.java

Updates.java

web.xml

struts.xml

index.jsp

insertr.jsp

error.jsp

edit.jsp

dsuccess.jsp

retrive.jsp

ssuccess.jsp

usuccess.jsp

 Output

 

What you are thinkig....

12 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:

    hi,
    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:

    @Parivallal

    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:

    Hi,
    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…

If you want a pic to show with your comment, go get a gravatar !
Please post your questions on Java4s Answers forum

Name*
Ask a Question ?
or
Mail*
Website



By posting your answer, you agree to our comments policy.
Most Recent Tutorials
Hibernate Recent Posts
Spring Recent Posts
Struts Recent Posts
Recomandded Links Current & UpComing Tutorials Java4s.com
Tutorials Online :
spring Hibernate struts Json Ajax Log4j Log4j
coreJava Servlets


UpComing :
Jsps,Web Services
Java4s is optimized for learning java technologies, all the examples in this site are constantly reviewed to avoid errors. While using this site you agree to have read and accepted our terms of use and privacy policy
Especially i have prepared this blog by keeping fresher's in mind, however it will be very useful for real time developers too.


© 2014 Java4s All rights reserved. | strPro4Tut v(2.0) Theme designed by Team Java4s.