What is JdbcTemplate Class?
by, 07-07-2012 at 06:31 PM (930 Views)
Following functions are performed by JdbcTemplate class.
Execute update statements
Stored procedure calls
Returned parameter extraction
Cache JDBC exceptions
Transalation of JDBC exceptions into generic and informative exceptions that are defined in spring dao package
Once JdbcTemplate instance are configured, they are thread safe. It is possible to use a single JdbcTemplate instance and it can be injected into multiple DAOs safely.
A DataSoruce is configured in the Spring configuration file when the JdbcTemplate class is used and its a common practice. It injects dependency into you DAO classes when that share DataSoruce and JdbcTemplate is created in the DataSource setter method.