public class ConnectionProxy
extends java.lang.Object
implements java.sql.Connection
| Modifier and Type | Field and Description |
|---|---|
private boolean |
_closed |
private JtdsConnection |
_connection |
private PooledConnection |
_pooledConnection |
| Constructor and Description |
|---|
ConnectionProxy(PooledConnection pooledConnection,
java.sql.Connection connection)
Constructs a new connection proxy.
|
| Modifier and Type | Method and Description |
|---|---|
void |
abort(java.util.concurrent.Executor executor) |
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.Array |
createArrayOf(java.lang.String typeName,
java.lang.Object[] elements) |
java.sql.Blob |
createBlob() |
java.sql.Clob |
createClob() |
java.sql.NClob |
createNClob() |
java.sql.SQLXML |
createSQLXML() |
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.
|
java.sql.Struct |
createStruct(java.lang.String typeName,
java.lang.Object[] attributes) |
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.
|
java.util.Properties |
getClientInfo() |
java.lang.String |
getClientInfo(java.lang.String name) |
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 |
getNetworkTimeout() |
java.lang.String |
getSchema() |
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.
|
boolean |
isValid(int timeout) |
boolean |
isWrapperFor(java.lang.Class arg0) |
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 |
setClientInfo(java.util.Properties properties) |
void |
setClientInfo(java.lang.String name,
java.lang.String value) |
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 |
setNetworkTimeout(java.util.concurrent.Executor executor,
int milliseconds) |
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 |
setSchema(java.lang.String schema) |
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.
|
java.lang.Object |
unwrap(java.lang.Class arg0) |
private void |
validateConnection()
Validates the connection state.
|
private PooledConnection _pooledConnection
private JtdsConnection _connection
private boolean _closed
public ConnectionProxy(PooledConnection pooledConnection, java.sql.Connection connection)
public void clearWarnings()
throws java.sql.SQLException
clearWarnings in interface java.sql.Connectionjava.sql.SQLException - if an error occurspublic void close()
close in interface java.lang.AutoCloseableclose in interface java.sql.Connectionpublic void commit()
throws java.sql.SQLException
commit in interface java.sql.Connectionjava.sql.SQLException - if an error occurspublic java.sql.Statement createStatement()
throws java.sql.SQLException
createStatement in interface java.sql.Connectionjava.sql.SQLException - if an error occurspublic java.sql.Statement createStatement(int resultSetType,
int resultSetConcurrency)
throws java.sql.SQLException
createStatement in interface java.sql.Connectionjava.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.Connectionjava.sql.SQLException - if an error occurspublic boolean getAutoCommit()
throws java.sql.SQLException
getAutoCommit in interface java.sql.Connectionjava.sql.SQLException - if an error occurspublic java.lang.String getCatalog()
throws java.sql.SQLException
getCatalog in interface java.sql.Connectionjava.sql.SQLException - if an error occurspublic int getHoldability()
throws java.sql.SQLException
getHoldability in interface java.sql.Connectionjava.sql.SQLException - if an error occurspublic int getTransactionIsolation()
throws java.sql.SQLException
getTransactionIsolation in interface java.sql.Connectionjava.sql.SQLException - if an error occurspublic java.util.Map getTypeMap()
throws java.sql.SQLException
getTypeMap in interface java.sql.Connectionjava.sql.SQLException - if an error occurspublic java.sql.SQLWarning getWarnings()
throws java.sql.SQLException
getWarnings in interface java.sql.Connectionjava.sql.SQLException - if an error occurspublic java.sql.DatabaseMetaData getMetaData()
throws java.sql.SQLException
getMetaData in interface java.sql.Connectionjava.sql.SQLException - if an error occurspublic boolean isClosed()
throws java.sql.SQLException
isClosed in interface java.sql.Connectionjava.sql.SQLException - if an error occurspublic boolean isReadOnly()
throws java.sql.SQLException
isReadOnly in interface java.sql.Connectionjava.sql.SQLException - if an error occurspublic java.lang.String nativeSQL(java.lang.String sql)
throws java.sql.SQLException
nativeSQL in interface java.sql.Connectionjava.sql.SQLException - if an error occurspublic java.sql.CallableStatement prepareCall(java.lang.String sql)
throws java.sql.SQLException
prepareCall in interface java.sql.Connectionjava.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.Connectionjava.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.Connectionjava.sql.SQLException - if an error occurspublic java.sql.PreparedStatement prepareStatement(java.lang.String sql)
throws java.sql.SQLException
prepareStatement in interface java.sql.Connectionjava.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.Connectionjava.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.Connectionjava.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.Connectionjava.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.Connectionjava.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.Connectionjava.sql.SQLException - if an error occurspublic void releaseSavepoint(java.sql.Savepoint savepoint)
throws java.sql.SQLException
releaseSavepoint in interface java.sql.Connectionjava.sql.SQLException - if an error occurspublic void rollback()
throws java.sql.SQLException
rollback in interface java.sql.Connectionjava.sql.SQLException - if an error occurspublic void rollback(java.sql.Savepoint savepoint)
throws java.sql.SQLException
rollback in interface java.sql.Connectionjava.sql.SQLException - if an error occurspublic void setAutoCommit(boolean autoCommit)
throws java.sql.SQLException
setAutoCommit in interface java.sql.Connectionjava.sql.SQLException - if an error occurspublic void setCatalog(java.lang.String catalog)
throws java.sql.SQLException
setCatalog in interface java.sql.Connectionjava.sql.SQLException - if an error occurspublic void setHoldability(int holdability)
throws java.sql.SQLException
setHoldability in interface java.sql.Connectionjava.sql.SQLException - if an error occurspublic void setReadOnly(boolean readOnly)
throws java.sql.SQLException
setReadOnly in interface java.sql.Connectionjava.sql.SQLException - if an error occurspublic java.sql.Savepoint setSavepoint()
throws java.sql.SQLException
setSavepoint in interface java.sql.Connectionjava.sql.SQLException - if an error occurspublic java.sql.Savepoint setSavepoint(java.lang.String name)
throws java.sql.SQLException
setSavepoint in interface java.sql.Connectionjava.sql.SQLException - if an error occurspublic void setTransactionIsolation(int level)
throws java.sql.SQLException
setTransactionIsolation in interface java.sql.Connectionjava.sql.SQLException - if an error occurspublic void setTypeMap(java.util.Map map)
throws java.sql.SQLException
setTypeMap in interface java.sql.Connectionjava.sql.SQLException - if an error occursprivate void validateConnection()
throws java.sql.SQLException
java.sql.SQLExceptionvoid processSQLException(java.sql.SQLException sqlException)
throws java.sql.SQLException
java.sql.SQLExceptionprotected void finalize()
finalize in class java.lang.Objectpublic java.sql.Array createArrayOf(java.lang.String typeName,
java.lang.Object[] elements)
throws java.sql.SQLException
createArrayOf in interface java.sql.Connectionjava.sql.SQLExceptionpublic java.sql.Blob createBlob()
throws java.sql.SQLException
createBlob in interface java.sql.Connectionjava.sql.SQLExceptionpublic java.sql.Clob createClob()
throws java.sql.SQLException
createClob in interface java.sql.Connectionjava.sql.SQLExceptionpublic java.sql.NClob createNClob()
throws java.sql.SQLException
createNClob in interface java.sql.Connectionjava.sql.SQLExceptionpublic java.sql.SQLXML createSQLXML()
throws java.sql.SQLException
createSQLXML in interface java.sql.Connectionjava.sql.SQLExceptionpublic java.sql.Struct createStruct(java.lang.String typeName,
java.lang.Object[] attributes)
throws java.sql.SQLException
createStruct in interface java.sql.Connectionjava.sql.SQLExceptionpublic java.util.Properties getClientInfo()
throws java.sql.SQLException
getClientInfo in interface java.sql.Connectionjava.sql.SQLExceptionpublic java.lang.String getClientInfo(java.lang.String name)
throws java.sql.SQLException
getClientInfo in interface java.sql.Connectionjava.sql.SQLExceptionpublic boolean isValid(int timeout)
throws java.sql.SQLException
isValid in interface java.sql.Connectionjava.sql.SQLExceptionpublic void setClientInfo(java.util.Properties properties)
throws java.sql.SQLClientInfoException
setClientInfo in interface java.sql.Connectionjava.sql.SQLClientInfoExceptionpublic void setClientInfo(java.lang.String name,
java.lang.String value)
throws java.sql.SQLClientInfoException
setClientInfo in interface java.sql.Connectionjava.sql.SQLClientInfoExceptionpublic boolean isWrapperFor(java.lang.Class arg0)
throws java.sql.SQLException
isWrapperFor in interface java.sql.Wrapperjava.sql.SQLExceptionpublic java.lang.Object unwrap(java.lang.Class arg0)
throws java.sql.SQLException
unwrap in interface java.sql.Wrapperjava.sql.SQLExceptionpublic void setSchema(java.lang.String schema)
throws java.sql.SQLException
setSchema in interface java.sql.Connectionjava.sql.SQLExceptionpublic java.lang.String getSchema()
throws java.sql.SQLException
getSchema in interface java.sql.Connectionjava.sql.SQLExceptionpublic void abort(java.util.concurrent.Executor executor)
throws java.sql.SQLException
abort in interface java.sql.Connectionjava.sql.SQLExceptionpublic void setNetworkTimeout(java.util.concurrent.Executor executor,
int milliseconds)
throws java.sql.SQLException
setNetworkTimeout in interface java.sql.Connectionjava.sql.SQLExceptionpublic int getNetworkTimeout()
throws java.sql.SQLException
getNetworkTimeout in interface java.sql.Connectionjava.sql.SQLExceptionGenerated on June 8 2013