Govt. Exams
Entrance Exams
TYPE_SCROLL_INSENSITIVE creates scrollable ResultSet (can move forward/backward) but changes made to database after ResultSet creation are not reflected.
CallableStatement is used to invoke stored procedures and functions. It extends PreparedStatement and supports IN, OUT, and INOUT parameters.
execute() returns boolean (true if ResultSet available), executeQuery() returns ResultSet for SELECT, executeUpdate() returns row count for INSERT/UPDATE/DELETE.
addBatch() adds SQL command to batch, executeBatch() executes all batched commands at once, improving performance significantly for multiple operations.
This is vulnerable to SQL injection as user input is directly concatenated. Using PreparedStatement with parameters prevents this: "SELECT * FROM users WHERE id=?"