During peak usage, a web application's response time degrades significantly. Which connection pool setting should be investigated?

  • Connection Timeout
  • Max Connections Per Partition
  • Min Pool Size
  • Partition Count
To address degraded response time during peak usage, investigate the Max Connections Per Partition setting, which controls the maximum number of connections allowed in each partition.

_________ in connection pools helps to identify and replace connections that are no longer viable.

  • Expiration
  • Monitoring
  • Replacement
  • Validation
Validation in connection pools helps to identify and replace connections that are no longer viable or have become stale.

When no connections are available in the pool, the request is put into a __________ until a connection becomes available.

  • buffer
  • hold
  • queue
  • stack
When no connections are available, the request is put into a queue until a connection becomes available in the pool.

To ensure efficient use of database connections, pools use a technique called _________.

  • Connection Caching
  • Connection Optimization
  • Connection Pooling
  • Connection Recycling
To ensure efficient use of database connections, pools use a technique called Connection Pooling.

The process of retrieving a connection from the pool, using it, and then returning it is known as _________.

  • Connection Fetching
  • Connection Recycling
  • Connection Recycling
  • Connection Releasing
The process of retrieving a connection from the pool, using it, and then returning it is known as Connection Fetching.

In connection pooling, the pool size is defined by the _________ and _________ parameters.

  • initialConnections, maxConnections
  • initialSize, maxSize
  • minConnections, maxConnections
  • minSize, maxSize
In connection pooling, the pool size is defined by the initialSize and maxSize parameters.

How can stale or broken database connections in the pool be handled effectively?

  • By ignoring them and letting the database manage it.
  • By logging the issue and continuing to use the connection.
  • By notifying the database administrator.
  • By removing them from the pool and establishing new connections.
Stale or broken database connections in the pool can be handled effectively by removing them from the pool and establishing new connections. This helps maintain a reliable and efficient connection pool for the servlet container.

What is the impact of setting a very high or very low size for the connection pool?

  • Both high and low sizes have a negative impact on performance.
  • High size can lead to resource wastage, while low size may cause performance issues.
  • High size improves performance, but low size reduces resource usage.
  • Setting size doesn't affect performance.
Setting a very high size for the connection pool can lead to resource wastage, while a very low size may cause performance issues. It's essential to find an optimal size to balance performance and resource usage effectively.

What is a common strategy for handling the situation when all connections in the pool are in use?

  • Automatically create more connections
  • Ignore the situation
  • Terminate the application
  • Wait for a connection to become available
Waiting for a connection to become available is a common strategy, ensuring that the application doesn't crash when all connections in the pool are in use.

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.

To set a date in a PreparedStatement, the method _________ is used.

  • setDate()
  • setDateValue()
  • setTime()
  • setTimestamp()
The setDate() method is used to set a date in a PreparedStatement when working with JDBC.

How do you handle transaction management when using PreparedStatement and CallableStatement?

  • Explicitly commit transactions using commit()
  • Rollback transactions using rollback()
  • Transactions are automatically managed
  • Use Connection.setAutoCommit(false)
To handle transactions with PreparedStatement and CallableStatement, set auto-commit to false using Connection.setAutoCommit(false) and then explicitly commit or rollback transactions using commit() and rollback() methods, respectively.