tyrex.resource.jdbc.xa

Class TyrexConnection

public abstract class TyrexConnection extends Object implements Connection

This class defines base methods for implementing java.sql.Connection so that an underlying java.sql.Connection may be pooled.

Subclasses are to implement TyrexConnection, TyrexConnection, {@ #getUnderlyingConnection}.

Author: Riad Mohammed

Constructor Summary
TyrexConnection()
Method Summary
voidclearWarnings()
voidclose()
Close this connection which may or may not close the underlying connection.
voidcommit()
StatementcreateStatement()
StatementcreateStatement(int resultSetType, int resultSetConcurrency)
StatementcreateStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability)
protected voidfinalize()
Close the connection when it is being garbage collected.
booleangetAutoCommit()
StringgetCatalog()
intgetHoldability()
DatabaseMetaDatagetMetaData()
intgetTransactionIsolation()
MapgetTypeMap()
SQLWarninggetWarnings()
protected abstract voidinternalClose()
Method that actually closes the connection.
protected abstract ConnectioninternalGetUnderlyingConnection()
Return the underlying connection.
abstract booleanisClosed()
Return true if the connection is closed.
booleanisReadOnly()
StringnativeSQL(String sql)
protected voidnotifyError(SQLException exception)
Called when an exception is thrown by the underlying connection.
CallableStatementprepareCall(String sql)
CallableStatementprepareCall(String sql, int resultSetType, int resultSetConcurrency)
CallableStatementprepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)
PreparedStatementprepareStatement(String sql)
PreparedStatementprepareStatement(String sql, int resultSetType, int resultSetConcurrency)
PreparedStatementprepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)
PreparedStatementprepareStatement(String sql, int autoGeneratedKeys)
PreparedStatementprepareStatement(String sql, int[] columnIndexes)
PreparedStatementprepareStatement(String sql, String[] columnNames)
voidreleaseSavepoint(Savepoint savepoint)
voidrollback()
voidrollback(Savepoint savepoint)
voidsetAutoCommit(boolean autoCommit)
voidsetCatalog(String catalog)
voidsetHoldability(int holdability)
voidsetReadOnly(boolean readOnly)
SavepointsetSavepoint()
SavepointsetSavepoint(String name)
voidsetTransactionIsolation(int level)
voidsetTypeMap(Map map)

Constructor Detail

TyrexConnection

public TyrexConnection()

Method Detail

clearWarnings

public void clearWarnings()

close

public void close()
Close this connection which may or may not close the underlying connection. And notify any listeners that the connection has been closed.

Throws: SQLException if there is a problem closing the connection

See Also: TyrexConnection

commit

public void commit()

createStatement

public Statement createStatement()

createStatement

public Statement createStatement(int resultSetType, int resultSetConcurrency)

createStatement

public Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability)

finalize

protected void finalize()
Close the connection when it is being garbage collected.

getAutoCommit

public boolean getAutoCommit()

getCatalog

public String getCatalog()

getHoldability

public int getHoldability()

getMetaData

public DatabaseMetaData getMetaData()

getTransactionIsolation

public int getTransactionIsolation()

getTypeMap

public Map getTypeMap()

getWarnings

public SQLWarning getWarnings()

internalClose

protected abstract void internalClose()
Method that actually closes the connection.

Throws: SQLException if there is a problem closing the connection

See Also: TyrexConnection

internalGetUnderlyingConnection

protected abstract Connection internalGetUnderlyingConnection()
Return the underlying connection.

The connection is not closed ie TyrexConnection returns false.

Returns: the underlying connection

Throws: SQLException if the connection cannot be retrieved.

See Also: TyrexConnection

isClosed

public abstract boolean isClosed()
Return true if the connection is closed.

Returns: true if the connection is closed.

isReadOnly

public boolean isReadOnly()

nativeSQL

public String nativeSQL(String sql)

notifyError

protected void notifyError(SQLException exception)
Called when an exception is thrown by the underlying connection.

The default implementation is to do nothing

Parameters: except The exception thrown by the underlying connection

prepareCall

public CallableStatement prepareCall(String sql)

prepareCall

public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency)

prepareCall

public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)

prepareStatement

public PreparedStatement prepareStatement(String sql)

prepareStatement

public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency)

prepareStatement

public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)

prepareStatement

public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys)

prepareStatement

public PreparedStatement prepareStatement(String sql, int[] columnIndexes)

prepareStatement

public PreparedStatement prepareStatement(String sql, String[] columnNames)

releaseSavepoint

public void releaseSavepoint(Savepoint savepoint)

rollback

public void rollback()

rollback

public void rollback(Savepoint savepoint)

setAutoCommit

public void setAutoCommit(boolean autoCommit)

setCatalog

public void setCatalog(String catalog)

setHoldability

public void setHoldability(int holdability)

setReadOnly

public void setReadOnly(boolean readOnly)

setSavepoint

public Savepoint setSavepoint()

setSavepoint

public Savepoint setSavepoint(String name)

setTransactionIsolation

public void setTransactionIsolation(int level)

setTypeMap

public void setTypeMap(Map map)
Original code is Copyright (c) 1999-2001, Intalio, Inc. All Rights Reserved. Contributions by MetaBoss team are Copyright (c) 2003-2005, Softaris Pty. Ltd. All Rights Reserved.