O'Reilly logo

Database Programming with JDBC & Java, Second Edition by George Reese

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

Connection

Synopsis

Interface Name: java.sql.Connection

Superclass: None

Immediate Subclasses: None

Interfaces Implemented: None

Availability: JDK 1.1

Description

Connection is the JDBC representation of a database session. It provides an application with Statement objects (and its subclasses) for that session. It also handles the transaction management for those statements. By default, each statement is committed immediately upon execution. You can use the Connection object to turn off this auto-commit feature for the session. In that event, you must expressly send commits, or any statements executed will be lost.

Class Summary

public interface Connection {
    static public final int TRANSACTION_NONE;
    static public final int TRANSACTION_READ_UNCOMMITTED;
    static public final int TRANSACTION_READ_COMMITTED;
    static public final int TRANSACTION_REPEATABLE_READ;
    static public final int TRANSACTION_SERIALIZABLE;

    void clearWarnings( ) throws SQLException;
    void close( ) throws SQLException;
    void commit( ) throws SQLException;
    Statement createStatement( ) throws SQLException;
    Statement createStatement(int type, int concur)
        throws SQLException;
    boolean getAutoCommit( ) throws SQLException;
    String getCatalog( ) throws SQLException;
    Map getTypeMap( ) throws SQLException; DatabaseMetaData getMetaData( ) throws SQLException; int getTransactionIsolation( ) throws SQLException; SQLWarning getWarnings( ) throws SQLException; boolean isClosed( ) throws SQLException; boolean isReadOnly( ) throws SQLException; ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required