Spring DAO JDBC

Motivation
  • DAO : Understand what Data Access Objects are and why one should use them.
  • Reduction of the boilerplate code : Demonstrate typical rich JDBC try/catch usage in opposite to the lean JdbcTemplate.
  • Template method pattern : Describe what 'template' in JdbcTemplate stands for. Identify GOF template method pattern.
  • JdbcDaoSupport interface : Know that programmer provides only DataSource (usually injected via IOC container) in order to get JdbcTemplate. Understand that this is convenient.
  • SQL exceptions : Know that standard SQLException descendants are not classified into a hierarchy and are inconvenient in general (in particular getNextException() method)
  • Additional abstraction layer : Identify additional layer of abstraction provided by Spring via SQL operations mappings
Exceptions
  • Spring DataAccessException hierarchy - Identify the hierarchy of Spring data access exception.
  • Particular Spring data access exceptions - Describe all the descendants of the DataAccessException. Identify situations in which each exception can be thrown.
  • SQLExceptionTranslator - Understand how Spring translates various SQL exceptions into its own hierarchy, particularly how error codes of standard DBMSs are transformed into the exceptions.
DataSource
  • Dependency Injection - Demonstrate various techniques of injecting DataSource into a JdbcTemplate.
  • Various DataSources - Recognize when (and how to) use DataSources provided with Spring (such as DriverManagerDataSource, SingleConnectionDataSource, AbstractDataSource and so forth).
  • Transactions - Identify how to manage transactions using Spring JDBC DAO.
  • Connections in general - Anything else connected directly with the topic of JDBC connection management in Spring JDBC DAO.
Basic use of JdbcTemplate
  • General information - Understand that JdbcTemplate is thread-safe and stateless. Describe that JdbcTemplate is usually injected into DAO beans as a singleton using Spring IOC container.
  • Queries - Recognize purpose of the RowMapper and RowCallBackHandler. Demonstrate usage of the JdbcTemplate convenience methods queryForXXX. Demonstrate usage of various overloaded versions of the query() method (both parametrized and not parametrized).
  • Updates - Identify proper usage of methods modifying data, particularly update(), execute() and batchUpdate().
Advanced use of JdbcTemplate
  • Stored procedures - Demonstrate how stored procedures can be called using execute() method. Demonstrate dealing with the both input and output parameters.
  • JdbcTemplate wrappers - Understand that JdbcTemplate wrappers are thread-safe. Know that classes implementing SimpleJdbcOperations interface (like SimpleJdbcTemplate) are convenient to use with Java >= 1.5. Identify other JdbcWrappers. Describe purposes of interfaces implemented by JdbcTemplate wrappers.
  • JdbcTemplate interfaces - Know the purpose of interfaces used by JdbcTemplate, such as PreparedStatementCreator, PreparedStatementSetter, BatchPreparedStatementSetter or SqlProvider.
  • LOB support - Demonstrate how to use LobHandler in order to deal with both BLOBs and CLOBs.
SQL operations mapping
  • Common operations - Demonstrate usage of classes mapping common SQL operation, such as SqlUpdate, SqlQuery or UpdatableSqlQuery.
  • Stored procedures - Demonstrate usage of classes mapping SQL procedures, such as StoredProcedure or SqlFunction.
Misc
  • Keys generators (like DataFieldMaxValueIncrementer).
  • Performance issues.
  • Integration of Spring JDBC with the application server.
  • JDBC vs ORM considerations.
  • Anything else connected with the topic what does not fit into the other categories (please note that Spring ORM is not a part of this exam).

你可能感兴趣的:(DAO,spring,sql,SQL Server,jdbc)