JDBC Connection Interface Flashcards
Creates a statement that can b e used to send SQL statements to the database.
Statement createStatement()
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.
DatabaseMetaData getMetaData()
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.
Clob createClob()
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.
Blob createBlob()
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.
String getSchema()
Gets a connection object from the driver manager.
DriverManager.getConnection()
Closes the connection. Automatically called if try-with-resources is used.
close()
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).
boolean getAutoCommit()
Creates a Savepoint object in the current transaction and returns that object.
Savepoint setSavepoint()
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)