|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sourceforge.jtds.jdbcx.proxy.ConnectionProxy
This class would be better implemented as a java.lang.reflect.Proxy. However, this feature was not added until 1.3 and reflection performance was not improved until 1.4. Since the driver still needs to be compatible with 1.2 and 1.3 this class is used to delegate the calls to the connection with minimal overhead.
Field Summary | |
private boolean |
_closed
|
private ConnectionJDBC2 |
_connection
|
private PooledConnection |
_pooledConnection
|
Fields inherited from interface java.sql.Connection |
TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE |
Constructor Summary | |
ConnectionProxy(PooledConnection pooledConnection,
java.sql.Connection connection)
Constructs a new connection proxy. |
Method Summary | |
void |
clearWarnings()
Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners. |
void |
close()
Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners. |
void |
commit()
Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners. |
java.sql.Statement |
createStatement()
Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners. |
java.sql.Statement |
createStatement(int resultSetType,
int resultSetConcurrency)
Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners. |
java.sql.Statement |
createStatement(int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners. |
protected void |
finalize()
Closes the proxy, releasing the connection. |
boolean |
getAutoCommit()
Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners. |
java.lang.String |
getCatalog()
Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners. |
int |
getHoldability()
Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners. |
java.sql.DatabaseMetaData |
getMetaData()
Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners. |
int |
getTransactionIsolation()
Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners. |
java.util.Map |
getTypeMap()
Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners. |
java.sql.SQLWarning |
getWarnings()
Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners. |
boolean |
isClosed()
Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners. |
boolean |
isReadOnly()
Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners. |
java.lang.String |
nativeSQL(java.lang.String sql)
Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners. |
java.sql.CallableStatement |
prepareCall(java.lang.String sql)
Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners. |
java.sql.CallableStatement |
prepareCall(java.lang.String sql,
int resultSetType,
int resultSetConcurrency)
Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners. |
java.sql.CallableStatement |
prepareCall(java.lang.String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners. |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql)
Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners. |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int autoGeneratedKeys)
Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners. |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int[] columnIndexes)
Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners. |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int resultSetType,
int resultSetConcurrency)
Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners. |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners. |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
java.lang.String[] columnNames)
Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners. |
(package private) void |
processSQLException(java.sql.SQLException sqlException)
Processes SQLExceptions. |
void |
releaseSavepoint(java.sql.Savepoint savepoint)
Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners. |
void |
rollback()
Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners. |
void |
rollback(java.sql.Savepoint savepoint)
Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners. |
void |
setAutoCommit(boolean autoCommit)
Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners. |
void |
setCatalog(java.lang.String catalog)
Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners. |
void |
setHoldability(int holdability)
Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners. |
void |
setReadOnly(boolean readOnly)
Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners. |
java.sql.Savepoint |
setSavepoint()
Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners. |
java.sql.Savepoint |
setSavepoint(java.lang.String name)
Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners. |
void |
setTransactionIsolation(int level)
Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners. |
void |
setTypeMap(java.util.Map map)
Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners. |
private void |
validateConnection()
Validates the connection state. |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private PooledConnection _pooledConnection
private ConnectionJDBC2 _connection
private boolean _closed
Constructor Detail |
public ConnectionProxy(PooledConnection pooledConnection, java.sql.Connection connection)
Method Detail |
public void clearWarnings() throws java.sql.SQLException
clearWarnings
in interface java.sql.Connection
java.sql.SQLException
- if an error occurspublic void close()
close
in interface java.sql.Connection
public void commit() throws java.sql.SQLException
commit
in interface java.sql.Connection
java.sql.SQLException
- if an error occurspublic java.sql.Statement createStatement() throws java.sql.SQLException
createStatement
in interface java.sql.Connection
java.sql.SQLException
- if an error occurspublic java.sql.Statement createStatement(int resultSetType, int resultSetConcurrency) throws java.sql.SQLException
createStatement
in interface java.sql.Connection
java.sql.SQLException
- if an error occurspublic java.sql.Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws java.sql.SQLException
createStatement
in interface java.sql.Connection
java.sql.SQLException
- if an error occurspublic boolean getAutoCommit() throws java.sql.SQLException
getAutoCommit
in interface java.sql.Connection
java.sql.SQLException
- if an error occurspublic java.lang.String getCatalog() throws java.sql.SQLException
getCatalog
in interface java.sql.Connection
java.sql.SQLException
- if an error occurspublic int getHoldability() throws java.sql.SQLException
getHoldability
in interface java.sql.Connection
java.sql.SQLException
- if an error occurspublic int getTransactionIsolation() throws java.sql.SQLException
getTransactionIsolation
in interface java.sql.Connection
java.sql.SQLException
- if an error occurspublic java.util.Map getTypeMap() throws java.sql.SQLException
getTypeMap
in interface java.sql.Connection
java.sql.SQLException
- if an error occurspublic java.sql.SQLWarning getWarnings() throws java.sql.SQLException
getWarnings
in interface java.sql.Connection
java.sql.SQLException
- if an error occurspublic java.sql.DatabaseMetaData getMetaData() throws java.sql.SQLException
getMetaData
in interface java.sql.Connection
java.sql.SQLException
- if an error occurspublic boolean isClosed() throws java.sql.SQLException
isClosed
in interface java.sql.Connection
java.sql.SQLException
- if an error occurspublic boolean isReadOnly() throws java.sql.SQLException
isReadOnly
in interface java.sql.Connection
java.sql.SQLException
- if an error occurspublic java.lang.String nativeSQL(java.lang.String sql) throws java.sql.SQLException
nativeSQL
in interface java.sql.Connection
java.sql.SQLException
- if an error occurspublic java.sql.CallableStatement prepareCall(java.lang.String sql) throws java.sql.SQLException
prepareCall
in interface java.sql.Connection
java.sql.SQLException
- if an error occurspublic java.sql.CallableStatement prepareCall(java.lang.String sql, int resultSetType, int resultSetConcurrency) throws java.sql.SQLException
prepareCall
in interface java.sql.Connection
java.sql.SQLException
- if an error occurspublic java.sql.CallableStatement prepareCall(java.lang.String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws java.sql.SQLException
prepareCall
in interface java.sql.Connection
java.sql.SQLException
- if an error occurspublic java.sql.PreparedStatement prepareStatement(java.lang.String sql) throws java.sql.SQLException
prepareStatement
in interface java.sql.Connection
java.sql.SQLException
- if an error occurspublic java.sql.PreparedStatement prepareStatement(java.lang.String sql, int autoGeneratedKeys) throws java.sql.SQLException
prepareStatement
in interface java.sql.Connection
java.sql.SQLException
- if an error occurspublic java.sql.PreparedStatement prepareStatement(java.lang.String sql, int[] columnIndexes) throws java.sql.SQLException
prepareStatement
in interface java.sql.Connection
java.sql.SQLException
- if an error occurspublic java.sql.PreparedStatement prepareStatement(java.lang.String sql, java.lang.String[] columnNames) throws java.sql.SQLException
prepareStatement
in interface java.sql.Connection
java.sql.SQLException
- if an error occurspublic java.sql.PreparedStatement prepareStatement(java.lang.String sql, int resultSetType, int resultSetConcurrency) throws java.sql.SQLException
prepareStatement
in interface java.sql.Connection
java.sql.SQLException
- if an error occurspublic java.sql.PreparedStatement prepareStatement(java.lang.String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws java.sql.SQLException
prepareStatement
in interface java.sql.Connection
java.sql.SQLException
- if an error occurspublic void releaseSavepoint(java.sql.Savepoint savepoint) throws java.sql.SQLException
releaseSavepoint
in interface java.sql.Connection
java.sql.SQLException
- if an error occurspublic void rollback() throws java.sql.SQLException
rollback
in interface java.sql.Connection
java.sql.SQLException
- if an error occurspublic void rollback(java.sql.Savepoint savepoint) throws java.sql.SQLException
rollback
in interface java.sql.Connection
java.sql.SQLException
- if an error occurspublic void setAutoCommit(boolean autoCommit) throws java.sql.SQLException
setAutoCommit
in interface java.sql.Connection
java.sql.SQLException
- if an error occurspublic void setCatalog(java.lang.String catalog) throws java.sql.SQLException
setCatalog
in interface java.sql.Connection
java.sql.SQLException
- if an error occurspublic void setHoldability(int holdability) throws java.sql.SQLException
setHoldability
in interface java.sql.Connection
java.sql.SQLException
- if an error occurspublic void setReadOnly(boolean readOnly) throws java.sql.SQLException
setReadOnly
in interface java.sql.Connection
java.sql.SQLException
- if an error occurspublic java.sql.Savepoint setSavepoint() throws java.sql.SQLException
setSavepoint
in interface java.sql.Connection
java.sql.SQLException
- if an error occurspublic java.sql.Savepoint setSavepoint(java.lang.String name) throws java.sql.SQLException
setSavepoint
in interface java.sql.Connection
java.sql.SQLException
- if an error occurspublic void setTransactionIsolation(int level) throws java.sql.SQLException
setTransactionIsolation
in interface java.sql.Connection
java.sql.SQLException
- if an error occurspublic void setTypeMap(java.util.Map map) throws java.sql.SQLException
setTypeMap
in interface java.sql.Connection
java.sql.SQLException
- if an error occursprivate void validateConnection() throws java.sql.SQLException
java.sql.SQLException
void processSQLException(java.sql.SQLException sqlException) throws java.sql.SQLException
java.sql.SQLException
protected void finalize()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |