The value-add provided by the Spring Framework JDBC abstraction is perhaps best shown by the sequence of actions outlined in the table below. The table shows what actions Spring will take care of and which actions are the responsibility of you, the application developer.
Table :- Spring JDBC - who does what?
The Spring Frame work takes care of all the low-level details that can make JDBC such a tedious API to develop with.
Choosing an approach for JDBC database access
You can choose among several approaches to form the basis for your JDBC data base access.In addition to three flavors of the JdbcTemplate, a new Simple Jdbc Insert and SimplejdbcCall approach optimizes data base metadata, and the RDBMS Object style takes a more object-oriented approach similar to that of JDO Query design. Once you start using one of these approaches, you can still mix and match to include a feature from a different approach. All approaches require a JDBC 2.0-compliant driver, and some advanced features require a JDBC 3.0 driver.
The Spring Framework's JDBC abstraction framework consists of four different packages, namely core, datasource, object, and support.
The org. spring frame work. jdbc. core package contains the JdbcTemplate class and its various callback interfaces, plus a variety of related classes. A sub package named org. spring frame work. jdbc. core. simple contains the Simple Jdbc Template class and the related SimpleJdbcInsert and SimpleJdbcCall classes. Another subpackage named org.springframework.jdbc.core.namedparam contains the NamedParameter Jdbc Template class and the related support classes.
The org. spring frame work.jdbc. datas ource package contains a utility class for easy Data Source access, and various simple Data Source implementations that can be used for testing and running un modified JDBC code outside of a Java EE container. A sub package named org.spring fame work.jdbc. data source.embedded provides support for creating in memory data base instances using Java database engines such as HSQL and H2.
The org. spring frame work. jdbc. object package contains classes that represent RDBMS queries, updates, and stored procedures as thread safe, reusable objects. This approach is modeled by JDO, although of course objects returned by queries are “disconnected” from the database.This higher level of JDBC abstraction depends on the lower-level abstraction in the org. spring frame work.jdbc.core package.
The org.spring fram work.jdbc. support package provides SQL Exception translation functionality and some utility classes. Exceptions thrown during JDBC processing are translated to exceptions defined in the org. spring frame work.dao package.This means that code using the Spring JDBC abstraction layer does not need to implement JDBC or RDBMS-specific error handling. All translated exceptions are unchecked, which gives you the option of catching the exceptions from which you can recover while allowing other exceptions to be propagated to the caller.
Java-Springs Related Interview Questions
|Adv Java Interview Questions||J2EE Interview Questions|
|Core Java Interview Questions||JSP Interview Questions|
|Java-Springs Interview Questions||Java Servlets Interview Questions|
|JMS(Java Message Service) Interview Questions||Hibernate Interview Questions|
|Java applet Interview Questions||Java Interview Questions|
|Framework7 Interview Questions||Java collections framework Interview Questions|
|Java 8 Interview Questions||Java Programmer Interview Questions|
Introduction To Spring Framework
New Features And Enhancements In Spring 3.0
The Ioc Container
Validation, Data Binding, And Type Conversion
Spring Expression Language (spel)
Aspect Oriented Programming With Spring
Spring Aop Apis
Data Access With Jdbc
Object Relational Mapping (orm) Data Access
Marshalling Xml Using O/x Mappers
Web Mvc Framework
Integrating With Other Web Frameworks
Portlet Mvc Framework
Remoting And Web Services Using Spring
Enterprise Javabeans (ejb) Integration
Jms (java Message Service)
Task Execution And Scheduling
Dynamic Language Support
All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.