Methods Summary |
---|
void | actualClose()Closes the physical connection involved in this.
con.close();
|
void | associateConnection(java.sql.Connection con, ManagedConnection mc)Replace the actual java.sql.Connection object with the one
supplied. Also replace ManagedConnection link.
this.mc = mc;
this.con = con;
|
protected void | checkValidity()Checks the validity of this object
if (isClosed) throw new SQLException ("Connection closed");
if (!valid) throw new SQLException ("Invalid Connection");
if(active == false) {
mc.checkIfActive(this);
}
|
public void | clearWarnings()Clears all warnings reported for the underlying connection object.
checkValidity();
con.clearWarnings();
|
public void | close()Closes the logical connection.
isClosed = true;
if ( mc != null ) {
//mc might be null if this is a lazyAssociatable connection
//and has not been associated yet or has been disassociated
mc.connectionClosed(null, this);
}
|
public void | commit()Commit the changes in the underlying Connection.
checkValidity();
con.commit();
|
public java.sql.Statement | createStatement()Creates a statement from the underlying Connection
checkValidity();
jdbcPreInvoke();
return con.createStatement();
|
public java.sql.Statement | createStatement(int resultSetType, int resultSetConcurrency)Creates a statement from the underlying Connection.
checkValidity();
jdbcPreInvoke();
return con.createStatement(resultSetType, resultSetConcurrency);
|
public java.sql.Statement | createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldabilty)Creates a statement from the underlying Connection.
checkValidity();
jdbcPreInvoke();
return con.createStatement(resultSetType, resultSetConcurrency,
resultSetHoldabilty);
|
public boolean | getAutoCommit()Retrieves the current auto-commit mode for the underlying Connection .
checkValidity();
return con.getAutoCommit();
|
public java.lang.String | getCatalog()Retrieves the underlying Connection object's catalog name.
checkValidity();
return con.getCatalog();
|
java.sql.Connection | getConnection()Returns the actual connection in this holder object.
return con;
|
public com.sun.gjc.spi.ConnectionHolder$ConnectionType | getConnectionType()
return myType_;
|
public int | getHoldability()Retrieves the current holdability of ResultSet objects created
using this connection object.
checkValidity();
return con.getHoldability();
|
ManagedConnection | getManagedConnection()Returns the ManagedConnection instance responsible
for this connection.
return mc;
|
public java.sql.DatabaseMetaData | getMetaData()Retrieves the DatabaseMetaData object from the underlying
Connection object.
checkValidity();
return con.getMetaData();
|
public int | getTransactionIsolation()Retrieves this Connection object's current transaction isolation level.
checkValidity();
return con.getTransactionIsolation();
|
public java.util.Map | getTypeMap()Retrieves the Map object associated with
Connection Object.
checkValidity();
return con.getTypeMap();
|
public java.sql.SQLWarning | getWarnings()Retrieves the the first warning reported by calls on the underlying
Connection object.
checkValidity();
return con.getWarnings();
|
public void | invalidate()Invalidates this object.
valid = false;
|
public boolean | isClosed()Retrieves whether underlying Connection object is closed.
return isClosed;
|
public boolean | isReadOnly()Retrieves whether this Connection object is read-only.
checkValidity();
return con.isReadOnly();
|
boolean | isWrapped()Returns whether it is wrapped already or not.
return wrappedAlready;
|
protected void | jdbcPreInvoke()
if ( myType_ == ConnectionType.LAZY_ASSOCIATABLE ) {
performLazyAssociation();
} else if ( myType_ == ConnectionType.LAZY_ENLISTABLE ) {
performLazyEnlistment();
}
|
public java.lang.String | nativeSQL(java.lang.String sql)Converts the given SQL statement into the system's native SQL grammer.
checkValidity();
return con.nativeSQL(sql);
|
protected void | performLazyAssociation()
try {
this.lazyAssocCm_.associateConnection( this, mcf_, cxReqInfo_);
} catch( ResourceException re ) {
String msg = sm.getString(
"jdbc.cannot_enlist", re.getMessage() +
" Cannnot Enlist ManagedConnection");
SQLException sqle = new SQLException( msg);
sqle.initCause( re );
throw sqle;
}
|
protected void | performLazyEnlistment()
try {
this.lazyEnlistCm_.lazyEnlist(mc);
} catch( ResourceException re ) {
String msg = sm.getString(
"jdbc.cannot_enlist" , re.getMessage() +
" Cannnot Enlist ManagedConnection");
SQLException sqle = new SQLException( msg );
sqle.initCause( re );
throw sqle;
}
|
public java.sql.CallableStatement | prepareCall(java.lang.String sql)Creates a CallableStatement object for calling database
stored procedures.
checkValidity();
jdbcPreInvoke();
return con.prepareCall(sql);
|
public java.sql.CallableStatement | prepareCall(java.lang.String sql, int resultSetType, int resultSetConcurrency)Creates a CallableStatement object for calling database
stored procedures.
checkValidity();
jdbcPreInvoke();
return con.prepareCall(sql, resultSetType, resultSetConcurrency);
|
public java.sql.CallableStatement | prepareCall(java.lang.String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldabilty)Creates a CallableStatement object for calling database
stored procedures.
checkValidity();
jdbcPreInvoke();
return con.prepareCall(sql, resultSetType, resultSetConcurrency,
resultSetHoldabilty);
|
public java.sql.PreparedStatement | prepareStatement(java.lang.String sql)Creates a PreparedStatement object for sending
paramterized SQL statements to database
checkValidity();
jdbcPreInvoke();
return con.prepareStatement(sql);
|
public java.sql.PreparedStatement | prepareStatement(java.lang.String sql, int autoGeneratedKeys)Creates a PreparedStatement object for sending
paramterized SQL statements to database
checkValidity();
jdbcPreInvoke();
return con.prepareStatement(sql,autoGeneratedKeys);
|
public java.sql.PreparedStatement | prepareStatement(java.lang.String sql, int[] columnIndexes)Creates a PreparedStatement object for sending
paramterized SQL statements to database
checkValidity();
jdbcPreInvoke();
return con.prepareStatement(sql,columnIndexes);
|
public java.sql.PreparedStatement | prepareStatement(java.lang.String sql, int resultSetType, int resultSetConcurrency)Creates a PreparedStatement object for sending
paramterized SQL statements to database
checkValidity();
jdbcPreInvoke();
return con.prepareStatement(sql, resultSetType, resultSetConcurrency);
|
public java.sql.PreparedStatement | prepareStatement(java.lang.String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldabilty)Creates a PreparedStatement object for sending
paramterized SQL statements to database
checkValidity();
jdbcPreInvoke();
return con.prepareStatement(sql, resultSetType, resultSetConcurrency,
resultSetHoldabilty);
|
public java.sql.PreparedStatement | prepareStatement(java.lang.String sql, java.lang.String[] columnNames)Creates a PreparedStatement object for sending
paramterized SQL statements to database
checkValidity();
jdbcPreInvoke();
return con.prepareStatement(sql,columnNames);
|
public void | releaseSavepoint(java.sql.Savepoint savepoint)Removes the given Savepoint object from the current transaction.
checkValidity();
con.releaseSavepoint(savepoint);
|
public void | rollback()Rolls back the changes made in the current transaction.
checkValidity();
con.rollback();
|
public void | rollback(java.sql.Savepoint savepoint)Rolls back the changes made after the savepoint.
checkValidity();
con.rollback(savepoint);
|
void | setActive(boolean actv)Sets the active flag to true
active = actv;
|
public void | setAutoCommit(boolean autoCommit)Sets the auto-commmit mode of the Connection object.
checkValidity();
con.setAutoCommit(autoCommit);
mc.setLastAutoCommitValue(autoCommit);
|
public void | setCatalog(java.lang.String catalog)Sets the catalog name to the Connection object
checkValidity();
con.setCatalog(catalog);
|
public void | setConnectionType(com.sun.gjc.spi.ConnectionHolder$ConnectionType type)
myType_ = type;
|
public void | setHoldability(int holdability)Sets the holdability of ResultSet objects created
using this Connection object.
checkValidity();
con.setHoldability(holdability);
|
public void | setLazyAssociatableConnectionManager(javax.resource.spi.LazyAssociatableConnectionManager cm)
lazyAssocCm_ = cm;
|
public void | setLazyEnlistableConnectionManager(javax.resource.spi.LazyEnlistableConnectionManager cm)
lazyEnlistCm_ = cm;
|
public void | setManagedConnection(ManagedConnection con)
this.mc = con;
|
public void | setReadOnly(boolean readOnly)Puts the connection in read-only mode as a hint to the driver to
perform database optimizations.
checkValidity();
con.setReadOnly(readOnly);
|
public java.sql.Savepoint | setSavepoint()Creates and unnamed savepoint and returns an object corresponding to that.
checkValidity();
return con.setSavepoint();
|
public java.sql.Savepoint | setSavepoint(java.lang.String name)Creates a savepoint with the name and returns an object corresponding to that.
checkValidity();
return con.setSavepoint(name);
|
public void | setTransactionIsolation(int level)Creates the transaction isolation level.
checkValidity();
con.setTransactionIsolation(level);
|
public void | setTypeMap(java.util.Map map)Installs the given Map object as the tyoe map for this
Connection object.
checkValidity();
con.setTypeMap(map);
|
void | wrapped(boolean wrapFlag)Sets the flag to indicate that, the connection is wrapped already or not.
this.wrappedAlready = wrapFlag;
|