|
|
The connection methods require a valid connection, returned from the getConnection() method.
connection.clearWarnings()
Clears all warnings for the connection, returning a void.
connection.close()
Closes the database connection and frees all connection resources, returning a void.
connection.commit()
Commits open transactions.
connection.createStatement([int resultSetType, int resultSetConcurrency])
Returns a Statement object, which is a mechanism for passing queries to the database, and receives results back, through its connection object. With the optional arguments, the generated ResultSet objects will have the specified type and concurrency.
connection.getAutoCommit()
Returns true if AutoCommit mode is set for the connection and false if it is not.
connection.getMetaData()
Returns a database metadata object containing metadata about the database with which the connection has been made.
connection.getTransactionIsolation()
Returns an integer containing the transaction isolation level for the connection. The transaction isolation levels can be one of the following: TRANSACTION_READ_ UNCOMMITTED, TRANSACTION_READ_COMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE, or TRANSACTION_NONE.
connection.getTypeMap
Returns a Map object associated with the connection.
connection.isClosed()
Returns true if the connection has been closed and false if it's still open.
connection.isReadOnly()
Returns true if the connection is read only and false if not.
connection.nativeSQL(String sql)
Returns a string with the supplied string converted to the system's native SQL.
connection.prepareStatement(String sql)
Prepares the statement to be sent to the database, which means you can make use of placeholders (or parameters). Use the setInt() and setString() methods to set the values of the parameters.
connection.rollback()
Undoes all changes in the current transaction.
connection.setAutoCommit(boolean mode)
Sets the connection's AutoCommit mode (true if set, false if not).
connection.setReadOnly(boolean mode)
Passing the method true sets the connection to read-only mode.
connection.setTransactionIsolation(int level)
The level can be one of the following: connection.TRANSACTION_READ_UNCOMMITTED, connection.TRANSACTION_READ_COMMITTED, connection.TRANSACTION_REPEATABLE_READ, or connection.TRANSACTION_SERIALIZABLE.
connection.setTypeMap(Map map)
Sets the type Map object for the connection.
|
|