jxDBCon 0.9z

org.sourceforge.jxdbcon.db2
Class DB2Connection

java.lang.Object
  |
  +--org.sourceforge.jxdbcon.AbstractConnection
        |
        +--org.sourceforge.jxdbcon.db2.DB2Connection
All Implemented Interfaces:
Cloneable, Connection, InfoKeys
Direct Known Subclasses:
DRDAConnection

public abstract class DB2Connection
extends AbstractConnection

The DB2Connection manages a JDBC Connection to a DB2 database server.

Version:
$Revision: 1.1 $, $Date: 2002/03/18 20:05:39 $
Author:
Keve Müller

Field Summary
protected  boolean autoCommit
          Are we in autoCommit mode?.
private  DatabaseMetaData dbMeta
          The metadata instance.
private  DB2Protocol proto
          The Protocol instance that talks to the backend.
 
Fields inherited from class org.sourceforge.jxdbcon.AbstractConnection
info, typeMap, warning
 
Fields inherited from interface java.sql.Connection
TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE
 
Fields inherited from interface org.sourceforge.jxdbcon.InfoKeys
CATALOG, DESCRIPTION, DRIVER, HOST, PASSWORD, PORT, SUBDRIVER, USER
 
Constructor Summary
DB2Connection()
           
 
Method Summary
 void close()
          Close the connection.
protected abstract  DB2Protocol connect(Properties info)
          Open a connection.
 Statement createStatement(int resultSetType, int resultSetConcurrency)
          Create a statement.
 boolean getAutoCommit()
          Return the auto commit state.
 EscapeContext getEscapeContext(Object obj, ConversionContext ctx)
          Create an EscapeContext.
 DatabaseMetaData getMetaData()
           
protected  void open(String url, Properties uinfo)
          Open a connection.
 CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency)
           
 PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency)
           
 
Methods inherited from class org.sourceforge.jxdbcon.AbstractConnection
clearWarnings, clone, commit, createStatement, createStatement, duplicate, fillPropertyInfo, finalize, getCatalog, getHoldability, getInfo, getTransactionIsolation, getTypeMap, getWarnings, isClosed, isReadOnly, nativeSQL, prepareCall, prepareCall, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, releaseSavepoint, rollback, rollback, setAutoCommit, setCatalog, setHoldability, setReadOnly, setSavepoint, setSavepoint, setTransactionIsolation, setTypeMap, takeOver, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

autoCommit

protected boolean autoCommit
Are we in autoCommit mode?. Initially the connection will be in auto commit mode.


dbMeta

private DatabaseMetaData dbMeta
The metadata instance.


proto

private DB2Protocol proto
The Protocol instance that talks to the backend.

Constructor Detail

DB2Connection

public DB2Connection()
Method Detail

close

public void close()
           throws SQLException
Description copied from class: AbstractConnection
Close the connection. Null everything. This function is implicitely invoked on an open Connection when it gets finalized.

Specified by:
close in interface Connection
Overrides:
close in class AbstractConnection
Throws:
SQLException - if an error occurs

connect

protected abstract DB2Protocol connect(Properties info)
                                throws SQLException
Open a connection.

SQLException

createStatement

public Statement createStatement(int resultSetType,
                                 int resultSetConcurrency)
                          throws SQLException
Description copied from class: AbstractConnection
Create a statement. Connection implementations override this.

Specified by:
createStatement in interface Connection
Specified by:
createStatement in class AbstractConnection
SQLException

getAutoCommit

public boolean getAutoCommit()
Return the auto commit state.

Specified by:
getAutoCommit in interface Connection
Overrides:
getAutoCommit in class AbstractConnection
Returns:
true.

getEscapeContext

public EscapeContext getEscapeContext(Object obj,
                                      ConversionContext ctx)
Description copied from class: AbstractConnection
Create an EscapeContext.

Specified by:
getEscapeContext in class AbstractConnection

getMetaData

public DatabaseMetaData getMetaData()

open

protected final void open(String url,
                          Properties uinfo)
                   throws SQLException
Open a connection. Open a connection to the given URL. Establish a connection to the backend, then query it for important information.

Overrides:
open in class AbstractConnection
SQLException

prepareCall

public CallableStatement prepareCall(String sql,
                                     int resultSetType,
                                     int resultSetConcurrency)
                              throws SQLException
Specified by:
prepareCall in interface Connection
Specified by:
prepareCall in class AbstractConnection
SQLException

prepareStatement

public PreparedStatement prepareStatement(String sql,
                                          int resultSetType,
                                          int resultSetConcurrency)
                                   throws SQLException
Specified by:
prepareStatement in interface Connection
Specified by:
prepareStatement in class AbstractConnection
SQLException

jxDBCon 0.9z

Copyright © 2001,2002 Keve Müller; see LICENSE file for details.