Spring Data Access

42. What is JdbcTemplate? 
Spring simplifies handling database access with the Spring JDBC Template exposed through the
JdbcTemplateclass. Spring JDBC Template simplifies the use of JDBC and helps to avoid common
errors. Spring JDBC Template is responsible for executing the core JDBC workflow.
Application code only needs to provide SQL and retrieve results. Spring JDBC Template executes
SQL queries or updates and initiates iteration overResultSet objects. It also catches JDBC
exceptions and translates them to the generic, more informative exception hierarchy. 
43. Why use an embedded database? Name few embedded databases
that Spring supports natively. 

Spring 3 introduced the support for embedded Java database engines. The embedded
databases are very useful during the development phase of the project. They provide almost the
same features as their standalone version, and at the same time are lightweight, have a quick start
time, and extremely fast. Being fast they are a big boon to developers who have to continuously
run their integration tests directly or as part of Continuous Integration (CI). 
An embedded database also improve testability and provides ease of configuration.
All these features allow developers to focus more on the development instead of how to
configure a data source. It eliminates the burden of bigger, bulkier databases like Oracle. 
Some embedded databases that Spring natively supports are HSQL, H2, and Derby. 

Comments

Popular posts from this blog

Spring Annotations

Spring Model View Controller (MVC)