When using a CallableStatement, the method _________ is used to register an OUT parameter.

  • outParameter()
  • registerOutParameter()
  • registerOutput()
  • setOutParameter()
When using a CallableStatement in JDBC, the registerOutParameter() method is used to register an OUT parameter.

A __________ strategy in connection pooling helps to optimize resource utilization under varying load conditions.

  • Adaptive Allocation
  • Dynamic Allocation
  • Incremental Allocation
  • Static Allocation
An Adaptive Allocation strategy in connection pooling helps optimize resource utilization under varying load conditions.

A web application experiences intermittent database connection issues. What connection pooling feature should be evaluated to resolve this?

  • Connection Retry
  • Idle Timeout
  • Max Pool Size
  • Min Pool Size
To address intermittent database connection issues, one should evaluate the Max Pool Size setting in connection pooling, which determines the maximum number of connections that can be created.

In a high-load scenario, a web application is unable to obtain database connections quickly. What aspect of connection pooling should be optimized?

  • Acquire Increment
  • Idle Timeout
  • Max Idle Time
  • Min Pool Size
To optimize obtaining database connections in a high-load scenario, focus on the Acquire Increment setting, which determines how many connections are added to the pool when all connections are in use.

How do you set a parameter in a PreparedStatement?

  • Using the set() method.
  • Using the setInt() method.
  • Using the setParameter() method.
  • Using the setParameter(int index, Object value) method.
Parameters in a PreparedStatement are set using specific methods like setInt(), setString(), etc., depending on the data type of the parameter.

What is a CallableStatement used for in JDBC?

  • Executing DDL statements.
  • Executing batch updates.
  • Executing dynamic SQL queries.
  • Executing stored procedures.
CallableStatement is used in JDBC for executing stored procedures in the database, providing a way to call database stored procedures from Java code.

In what scenarios is CallableStatement preferable over PreparedStatement?

  • Executing SQL queries with input parameters
  • Handling batch updates
  • Handling stored procedure calls
  • Optimizing read-only operations
CallableStatement is preferable when dealing with stored procedures as it allows the execution of precompiled SQL queries, making it suitable for scenarios where stored procedures are used.

A PreparedStatement can be optimized by the JDBC driver using __________.

  • batch processing
  • caching
  • connection pooling
  • query optimization
A PreparedStatement can be optimized by the JDBC driver using connection pooling, which involves reusing database connections to improve performance.

In a CallableStatement, the method _________ is used to execute a SQL function.

  • execute()
  • executeFunction()
  • executeQuery()
  • executeUpdate()
In a CallableStatement, the method executeFunction() is used to execute a SQL function.

To improve performance, a PreparedStatement uses _________ to precompile SQL statements.

  • compile()
  • precompile()
  • prepare()
  • prepareStatement()
To improve performance, a PreparedStatement uses the prepareStatement() method to precompile SQL statements.