Flashcards in JDBC Connection Interface Deck (18):
Creates a statement that can b e used to send SQL statements to the database.
Creates a PreparedStatement object that can contain SQL statements. The SQL statement can have IN parameters; they may contain '?' symbol(s), which are used as placeholders for passing actual values later.
PreparedStatement prepareStatement(String sql)
Creates a CallableStatement object for calling stored procedures in the database. The SQL statement can have IN or OUT parameters; they may contain '?' symbol(s), which are used as placeholders for passing actual values later.
CallableStatement prepareCall(String sql)
Gets the DataBaseMetaData object. This metadata contains useful information, such as schema information, table information etc., which is especially useful when you don't know the underlying database.
Returns a Clob object. CLOB (Character Large Object) is a built in type in SQL; it can be used to store a column value in a row of a database table.
Returns a blob object. BLOB (Binary Large Object) is a built in type in SQL; it can b e used to store a column value in a row of a database table.
When passed the schema name, it sets this Connection object to the database schema to access.
void setSchema(String schema)
Returns the schema name of the database associated with this connection object; returns null if no schema is associated with it.
Gets a connection object from the driver manager.
Closes the connection. Automatically called if try-with-resources is used.
Sets the auto-commit mode to true or false. By default, this is set to true.
void setAutoCommit(boolean autoCommit)
Returns the auto commit mode currently set (true means auto commit mode is set, false means it is not).
Creates a Savepoint object in the current transaction and returns that object.
Creates a Savepoint object in the current transaction with a name associated with it and returns that object.
Savepoint setSavepoint(String name)
Removes the given Savepoint object and subsequent Savepoint objects from the current transaction.
void releaseSavepoint(Savepoint savepoint)
Rolls back to the given Savepoint state. Throws a SQLException if the rollback cannot be done.
void rollback(Savepoint savepoint)
Rolls back all changes made in the current transaction. Throws a SQLException if there is nothing to roll back, like if auto-commit mode is on.