Get all updates of Java4s
Follow Us: Email Newsletter

Spring JDBC Hello World Example, Create Table In Database

Spring » On Feb 11, 2012 { 14 Comments } By Sivateja

Let us see how to create a table in database using spring JDBC.

Files Required

  • spconfig.xml

Directory Structure



table created

Note:  See in  i have used execute() method which will returns void, in fact we can use update() too but this will returns some int value.  So better execute() for creating these type of jobs.

You Might Also Like

  ♦ About Author ♦

Full Stack( Java/J2EE & UI/UX ) Developer and founder of Java4s - Get It Yourself, A popular Java/J2EE Programming Blog. Sign-up for the Email Newsletter for your daily dose of Java tutorials.


14 Responses to “Spring JDBC Hello World Example, Create Table In Database”
  1. sumit says:

    For “Spring JDBC Hello World Example” can u tell me the jars required.
    On clicking “Download Now” button, it gives Page Not Found.

  2. Java4s says:


    Oops.. seems its the broken link, sorry sumit i will update and let you know soon. ( I will send the update to your mail id provided here )

    Thank you so much for telling this issue.

  3. Java4s says:


    Download links updated, can now check from your end.

    thank you.

  4. Saket says:

    Thanks for the wonderful effort by the Java 4s team for presenting these technologies in a simpler way.
    But Please explain Spring MVC with examples .

  5. sorabh says:


    Great tutorial.I appreciate your work.While implementing,I have come across a mistake in your code
    jt.execute(“create table sptest(sno number(3), sname varchar(10))”);
    I modified this by
    jt.execute(“create table sptest(sno int(3), sname varchar(10))”);
    and it works fine.

    Good luck

  6. chaitanya says:

    Your tutorials are very clear to understand and awesome. Any one understood very easily. Thank you very much. Please provide tutorials for spring-MVC and Spring-ORM please. Thank you very much sir.

  7. chandu says:

    I never seen this kind of tutorial before……really helpful to evryone…wishing u all the best to java4s team…

  8. nidhi says:

    can u please mention jar files required to run this programme..
    there is an error “JdbcTemplate can not resolve to a type” on “”.

  9. Hemanth says:

    This tutorial is good for the beginners, Can you explain Spring MVC with some more examples…

  10. aravind says:

    we have JdbcTemplate in spring jdbc module so why HibernateTemplate has come
    reply with brief explain.

    what is main difference between JdbcTemplate and HibernateTemplate?


  11. vijay says:

    can u explain flow of this program i am not getting where it starts?

  12. Pavan says:

    Hi Java4s,
    Can you please tell which are the jars we have to use??

    I have been through your all topics, all are good..

    Needed brief explanation too for all your topics..!!

  13. Tamilselvan says:

    Hi Java4s,

    I want to know how to connect mysql i trying to connect it throws error. so,please provide the code to connect mysql..!!

  14. Tapas says:

    can u explain the flow of program


By posting your answer, you agree to our comments policy.
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_Logo Hibernate Recent Posts Spring_Logo Spring Recent Posts Struts_Logo Struts Recent Posts
Useful Links Current & UpComing Tutorials
  Web Services [ SOAP ], JSP
Contact | About Us | Privacy Policy | Advertise With Us

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