Programmatic Transaction Management: should be used for few transaction operations.

Declarative Transaction Management: should be used for many transaction operations.

Spring JDBC Interview Questions

293) What are the advantages of JdbcTemplate in spring?

Ans: Less code: By using the JdbcTemplate class, you don't need to create connection,statement,start transaction,commit transaction and close connection to execute different queries. You can execute the query directly.

294) What are classes for spring JDBC API?Ans:

JdbcTemplate

SimpleJdbcTemplate

NamedParameterJdbcTemplate

SimpleJdbcInsert

SimpleJdbcCall

295) How can you fetch records by spring JdbcTemplate?

Ans: You can fetch records from the database by the query method of JdbcTemplate. There are two interfaces to do this:

ResultSetExtractor

RowMapper

296) What is the advantage of NamedParameterJdbcTemplate?

Ans: NamedParameterJdbcTemplate class is used to pass value to the named parameter. A named parameter is better than ? (question mark of PreparedStatement).

It is better to remember.

297) What is the advantage of SimpleJdbcTemplate?

Ans: The SimpleJdbcTemplate supports the feature of var-args and autoboxing.

Spring AOP Interview Questions

298) What is AOP?

Ans: AOP is an acronym for Aspect Oriented Programming. It is a methodology that divides the program logic into pieces or parts or concerns.

It increases the modularity and the key unit is Aspect.

299) What are the advantages of spring AOP?

Ans: AOP enables you to dynamically add or remove concern before or after the business logic. It is pluggable and easy to maintain.