DB2 Everyplace 9.1.1 for Lotus Expeditor 6.1.1

Connection interface

The Connection interface establishes a connection (session) with a specific database. Within the context of a Connection, SQL statements are executed and results are returned.

A Connection's database is able to provide information describing its tables, its supported SQL grammar, its stored procedures, the capabilities of this connection, and so on. This information is obtained with the getMetaData method.

java.sql package

public interface Connection

Table 1 lists the methods in the Connection interface that are supported by DB2® Everyplace®.

Table 1. Connection interface methods
Method return value type Method
void clearWarnings()

Clears all warnings reported for this Connection object.

void close()

Releases a Connection's database and JDBC resources immediately instead of waiting for them to be automatically released.

void commit()

Makes all changes made because the previous commit or rollback permanent and releases any database locks currently held by the Connection.

Blob createBlob()

Creates a Blob object. The object that is returned contains no data. To add data to the Blob object, use the setBinaryStream and setBytes methods of the Blob interface.

Statement createStatement()

Creates a Statement object for sending SQL statements to the database.

Statement createStatement( int resultSetType, int resultSetConcurrency) JDBC 2.0.

Creates a Statement object that will generate ResultSet objects with the given type and concurrency.

boolean getAutoCommit() JDBC 4.0

Retrieves the current autocommit mode for this Connection object.

DatabaseMetaData getMetaData()

Gets the metadata regarding this Connection's database.

int getTransactionIsolation()

Gets the transaction isolation level of this Connection object.

SQLWarning getWarnings()

Returns the first warning reported by calls on this Connection.

boolean isClosed()

Tests to see if a Connection is closed.

CallableStatement prepareCall(String sql)

Creates a CallableStatement object for calling database stored procedures.

PreparedStatement prepareStatement(String sql)

Creates a PreparedStatement object for sending parameterized SQL statements to the database.

PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) JDBC 2.0.

Creates a PreparedStatement object that will generate ResultSet objects with the given type and concurrency.

Savepoint setSavepoint()

Creates an unnamed savepoint in the current transaction and returns the new Savepoint object that represents it.

Savepoint setSavepoint(String name)

Creates a savepoint with the given name in the current transaction and returns the new Savepoint object that represents it.

void rollback()

Drops all changes made because the previous commit or rollback and releases any database locks currently held by this Connection object.

void releaseSavepoint(Savepoint savepointname)

Removes the given Savepoint object from the current transaction.

void rollback(Savepoint savepointname)

Drops all changes made after the given Savepoint object was set.

void setAutoCommit(boolean autoCommit)

Sets this Connection's autocommit mode.

void setTransactionIsolation(int level)

Attempts to change the transaction isolation level of this Connection object.

Related tasks
Developing DB2 Everyplace Java applications
Related reference
SQLState messages reported by JDBC
Overview of DB2 Everyplace JDBC support


Library | Support | Terms of use |

Last updated: July, 2007
(C) Copyright IBM Corporation 2004, 2007. All Rights Reserved.
This information center is built on Eclipse. (http://www.eclipse.org)