Skip to main content

Posts

Showing posts with the label ORM.

Spring JdbcTemplate : Working, configuration, advantages and CRUD operation example

Spring JdbcTemplate  Spring JdbcTemplate is a powerful mechanism to connect to the database and execute SQL queries. It internally uses JDBC api, but eliminates a lot of problems of JDBC API.it provides excellent integration with JDBC API and provides JdbcTemplate utility class that we can use to avoid boiler-plate code from our database operations logic such as Opening/Closing Connection, ResultSet, PreparedStatement etc. Issues with old JDBC API: Native JDBC Api have so many issues and challenges. Some of the JDBC api issues are as follows. We need to write a lot of code before and after executing the query, such as creating connection, statement, closing resultset, connection etc. We need to perform exception handling code on the database logic. We need to handle transaction. Repetition of all these codes from one to another database logic is a time consuming task. Advantage of Spring JdbcTemplate Spring JdbcTemplate eliminates all the above mentioned problems of...