Entrance Exams
Govt. Exams
Setting autoCommit to false enables manual transaction management where commit() must be explicitly called.
PreparedStatement uses type-specific setter methods like setInt(), setString(), setDate() to bind parameters.
TYPE_SCROLL_INSENSITIVE doesn't reflect concurrent database changes, while TYPE_SCROLL_SENSITIVE may reflect such changes.
executeBatch() returns an int array where each element represents the number of rows affected by each statement in the batch.
Connection.getMetaData() returns a DatabaseMetaData object containing information about the database and driver.
commit() finalizes the transaction and persists all changes made since the last commit or rollback.
ClassNotFoundException is thrown when Class.forName() cannot locate the JDBC driver class.
DriverManager.getConnection() establishes a connection to the database and returns a Connection object.
executeUpdate() returns an int representing the number of rows affected by the SQL statement execution.
PreparedStatement pre-compiles SQL and uses parameterized queries, preventing SQL injection and improving performance.