Loading

Quipoin Menu

Learn • Practice • Grow

spring / Spring JdbcTemplate
mcq
Direction: Choose the correct option

Q1.

What is Spring JDBC Template?
A. A central class in Spring JDBC to simplify database operations
B. A template for JDBC
C. An ORM tool
D. None
Direction: Choose the correct option

Q2.

Which package contains JdbcTemplate?
A. org.springframework.jdbc.core
B. org.springframework.jdbc
C. org.springframework.orm
D. org.springframework.data
Direction: Choose the correct option

Q3.

How do you create a JdbcTemplate bean?
A. new JdbcTemplate(dataSource)
B. Using @Bean
C. Both A and B
D. None
Direction: Choose the correct option

Q4.

What method do you use to execute a SELECT query that returns a list?
A. query()
B. queryForList()
C. queryForObject()
D. All of the above
Direction: Choose the correct option

Q5.

What is a RowMapper used for?
A. To map each row of ResultSet to an object
B. To map rows to columns
C. To execute queries
D. None
Direction: Choose the correct option

Q6.

How do you execute an update (INSERT, UPDATE, DELETE) with JdbcTemplate?
A. update() method
B. execute() method
C. query() method
D. batchUpdate()
Direction: Choose the correct option

Q7.

How do you execute a query that returns a single value (e.g., count)?
A. queryForObject()
B. queryForValue()
C. query()
D. execute()
Direction: Choose the correct option

Q8.

What exception does JdbcTemplate throw on SQL error?
A. DataAccessException (unchecked)
B. SQLException (checked)
C. RuntimeException
D. JdbcException
Direction: Choose the correct option

Q9.

How do you perform batch updates with JdbcTemplate?
A. batchUpdate()
B. updateBatch()
C. executeBatch()
D. None
Direction: Choose the correct option

Q10.

What is NamedParameterJdbcTemplate?
A. A wrapper around JdbcTemplate that supports named parameters
B. A template for named queries
C. A different JDBC template
D. None