It handles exceptions occurred during database transaction and converts them into more informative ones.(Example : queryForMap(), queryForList(), etc.) It offers wide range of built in query methods to fetch records from database.We can use JdbcTemplate for all DML(create, update, insert and delete, etc) and DDL(table creation, drop, alteration, etc.) operations.Using JdbcTemplate, we can eliminate boilerplate code in our application, like opening the database connection, preparing statements, closing the connections after completion of the operation, etc.This JdbcTemplate class is part of the package.Īlso, the JdbcTemplate class is a thread safe class, and we can use one instance in different DAO implementation classes by injecting it into that class. This class also handles common tasks like obtaining database connections, preparing statements, executing the statements, processing the result set and closing the resources, etc. The Spring framework provides a JdbcTemplate class, which makes coding related to the database related operations simpler.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |