Login with  Log in with facebook
Hiring Manager? SIGN UP HERE
0   JdbcTemplate

can someone explain me what JdbcTemplate does in Spring.

Eric Smith
09/07/2011 at 10:27
1 Answer

This class simply wraps JDBC operations like SELECT and UPDATE. If you use it, you won't have to touh the Connection, PreparedStatement, and ResultSet objects, and it will handle all th try / catch / finally blocks required to ensure that resources are returned to the database when the operation is complete.

One other benefit is that it can log all of the SQL which it is asked to perform.

It's often used with a DAO (Data Access Object), which can be a subclass of Spring's JdbcDaoSupport. You could also use it directly (even without ever starting a Spring ApplicationContext). It just needs a JDBC DataSource object.

Michael Zalewski
09/07/2011 at 12:00

If you want to post any answer to this forum then you need to log in.
Schedule a Demo

Schedule a Demo with us

Name *
Email *
Phone *
Company *