Newsletter

Spring JdbcTemplate Update() Insert Query Example

Spring » on Feb 11, 2012 { 8 Comments } By Sivateja

Spring JDBC, will see how to insert a record into database using JdbcTemplate class.  i mean using insert query in Spring JDBC using JdbcTemplate’s update() method.  Reason why i have used update() method for insert sql is update() method will returns the number of record(s) inserted.

Files Required

  • SpringJdbcInsert.java
  • OurLogic.java
  • spconfig.xml

Directory Structure

SpringJdbcInsert.java

OurLogic.java

spconfig.xml

Output:

1 row(s) inserted  [ Am not giving screen short, hope you will trust me ;) ]
Note:  Even delete also same….

You Might Also Like

  ::. About the Author .::

Java4s_Author
- Full Stack Java/J2EE & UI Web Developer
Founder of Java4s - Get It Yourself, A popular Java/J2EE Programming Blog, Love Java and UI frameworks.
You can sign-up for the Email Newsletter for your daily dose of Java tutorials.

Comments

8 Responses to “Spring JdbcTemplate Update() Insert Query Example”
  1. Nagendra says:

    Hi,sir
    ur site is excellent for developers.
    pls provide spring with hibernate,spring mvc,aop asap.
    How much time it will take to complete remaing tasks.

  2. Java4s says:

    @Nagendra

    Hi,

    We will post rest of spring modules as soon as possible, but we can’t specify exact time frame, hope you will understand.

    Specially AOP we are planning little big [ covering almost all consents ], be in touch with our newsletters and Facebook/twitter to get updates.

    Thank you.

  3. shyamkumar says:

    plz provide spring remaining modules(mvc,orm,AOP) and intigrations with struts,springs and hibernate .
    it is useful to us…

  4. ashok says:

    Excellent work, really helping to the programmers alot….

  5. Sumanth says:

    What can i say about this site.?? It simply wow..!!
    Great Work…!!

  6. houssam says:

    Maybe I m one year late, but this is an incredible site for learning spring in a simple way.

    thank you.

  7. chetan says:

    there is no need to create pojo class here? why?

  8. Jeski says:

    Hello sir, Will u please provide me jar files for jdbctemplated class related programs.
    Like above one

Name*
Mail*
Website



By posting your answer, you agree to our comments policy.
Most Recent Posts from Top Categories
Hibernate Spring Struts
Contact | About Us | Privacy Policy | Advertise With Us

© 2010 - 2018 Java4s - Get It Yourself.
The content is copyrighted to Sivateja Kandula and may not be reproduced on other websites.