Govt Exams
Unclosed connections remain allocated and unavailable for other operations, eventually exhausting the connection pool and causing connection exhaustion errors.
Connection pooling maintains a pool of reusable connections, reducing the overhead of creating new connections for each request, improving application performance.
The execute() method returns a boolean and can handle multiple result sets via getResultSet(), getUpdateCount(), and getMoreResults() methods.
Type 4 drivers are pure Java implementations that directly communicate with the database, making them platform-independent and most portable.
next() returns false when the cursor is positioned beyond the last row, indicating no more rows available.
ResultSetMetaData provides column information directly from the ResultSet without additional queries.
execute() returns true/false and handles any SQL, while executeUpdate() returns affected rows count for DML statements only.
DatabaseMetaData provides information about the database, tables, columns, and other database properties.
getColumnCount() returns the total number of columns present in the ResultSet.
PreparedStatement offers both pre-compilation for performance and SQL injection prevention through parameterized queries.