|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectvelosurf.sql.ConnectionWrapper
public class ConnectionWrapper
Connection wrapper class. Allows the handling of a busy state
| Field Summary | |
|---|---|
(package private) static java.lang.reflect.Method |
_createArrayOf
|
(package private) static java.lang.reflect.Method |
_createBlob
|
(package private) static java.lang.reflect.Method |
_createClob
|
(package private) static java.lang.reflect.Method |
_createNClob
|
(package private) static java.lang.reflect.Method |
_createSQLXML
|
(package private) static java.lang.reflect.Method |
_createStruct
|
(package private) static java.lang.reflect.Method |
_getClientInfo
|
(package private) static java.lang.reflect.Method |
_getClientInfo2
|
(package private) static java.lang.reflect.Method |
_isValid
|
(package private) static java.lang.reflect.Method |
_isWrapperFor
|
(package private) static java.lang.reflect.Method |
_setClientInfo
|
(package private) static java.lang.reflect.Method |
_setClientInfo2
|
private int |
busy
Busy state. |
private java.sql.PreparedStatement |
checkStatement
statement used to check connection ("select 1"). |
private boolean |
closed
Closed state. |
private java.sql.Connection |
connection
Wrapped connection. |
private DriverInfo |
driver
Infos on the driver. |
private long |
lastUse
Last use |
| Fields inherited from interface java.sql.Connection |
|---|
TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE |
| Constructor Summary | |
|---|---|
ConnectionWrapper(DriverInfo driver,
java.sql.Connection connection)
Constructor. |
|
| Method Summary | ||
|---|---|---|
boolean |
check()
Check connection. |
|
void |
clearWarnings()
Clear SQL warnings. |
|
void |
close()
Close. |
|
void |
commit()
Commit. |
|
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()
Create a statement. |
|
java.sql.Statement |
createStatement(int i,
int j)
Create a statement. |
|
java.sql.Statement |
createStatement(int i,
int j,
int k)
Create a statement. |
|
java.sql.Struct |
createStruct(java.lang.String typeName,
java.lang.Object[] attributes)
|
|
void |
enterBusyState()
Enter busy state. |
|
boolean |
getAutoCommit()
Get autocommit flag. |
|
java.lang.String |
getCatalog()
Catalog getter. |
|
java.util.Properties |
getClientInfo()
|
|
java.lang.String |
getClientInfo(java.lang.String name)
|
|
private static java.lang.reflect.Method |
getConnectionMethod(java.lang.String name,
java.lang.Class[] parameterTypes)
|
|
int |
getHoldability()
Get holdability. |
|
long |
getLastInsertId(java.sql.Statement statement)
Get last inserted ID. |
|
long |
getLastUse()
Get last use timestamp |
|
java.sql.DatabaseMetaData |
getMetaData()
Get meta data |
|
int |
getTransactionIsolation()
Transaction isolation getter. |
|
java.util.Map |
getTypeMap()
Get type map. |
|
java.sql.SQLWarning |
getWarnings()
Get SQL warnings. |
|
boolean |
isBusy()
Check busy state. |
|
boolean |
isClosed()
Check the closed state. |
|
boolean |
isReadOnly()
Check the read-only state. |
|
boolean |
isValid(int timeout)
|
|
boolean |
isWrapperFor(java.lang.Class<?> iface)
|
|
void |
leaveBusyState()
Leave busy state. |
|
java.lang.String |
nativeSQL(java.lang.String s)
Gets native SQL for a query. |
|
java.sql.CallableStatement |
prepareCall(java.lang.String s)
Prepare a callable statement. |
|
java.sql.CallableStatement |
prepareCall(java.lang.String s,
int i,
int j)
Prepare a call. |
|
java.sql.CallableStatement |
prepareCall(java.lang.String s,
int i,
int j,
int k)
Prepare a callable statement. |
|
java.sql.PreparedStatement |
prepareStatement(java.lang.String s)
Prepare a statement. |
|
java.sql.PreparedStatement |
prepareStatement(java.lang.String s,
int i)
Prepare a statement. |
|
java.sql.PreparedStatement |
prepareStatement(java.lang.String s,
int[] ai)
Prepare a statement. |
|
java.sql.PreparedStatement |
prepareStatement(java.lang.String s,
int i,
int j)
Prepare a statement. |
|
java.sql.PreparedStatement |
prepareStatement(java.lang.String s,
int i,
int j,
int k)
Prepare a statement. |
|
java.sql.PreparedStatement |
prepareStatement(java.lang.String s,
java.lang.String[] as)
Prepare a statement. |
|
void |
releaseSavepoint(java.sql.Savepoint savepoint)
Release savepoint. |
|
void |
rollback()
Rollback. |
|
void |
rollback(java.sql.Savepoint savepoint)
Rollback. |
|
void |
setAutoCommit(boolean flag)
Set autocommit flag. |
|
void |
setCatalog(java.lang.String s)
Catalog setter. |
|
void |
setClientInfo(java.util.Properties properties)
|
|
void |
setClientInfo(java.lang.String name,
java.lang.String value)
|
|
void |
setHoldability(int i)
Set holdability. |
|
void |
setReadOnly(boolean flag)
set read-only flag |
|
java.sql.Savepoint |
setSavepoint()
Savepoint setter. |
|
java.sql.Savepoint |
setSavepoint(java.lang.String s)
Set named savepoint. |
|
void |
setTransactionIsolation(int i)
Transaction isolation setter. |
|
void |
setTypeMap(java.util.Map map)
Set type map. |
|
java.sql.Connection |
unwrap()
Unwrap the connection. |
|
|
unwrap(java.lang.Class<T> iface)
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private DriverInfo driver
private java.sql.Connection connection
private int busy
private long lastUse
private boolean closed
private java.sql.PreparedStatement checkStatement
static java.lang.reflect.Method _createClob
static java.lang.reflect.Method _createBlob
static java.lang.reflect.Method _createNClob
static java.lang.reflect.Method _createSQLXML
static java.lang.reflect.Method _isValid
static java.lang.reflect.Method _setClientInfo
static java.lang.reflect.Method _setClientInfo2
static java.lang.reflect.Method _getClientInfo
static java.lang.reflect.Method _getClientInfo2
static java.lang.reflect.Method _createArrayOf
static java.lang.reflect.Method _createStruct
static java.lang.reflect.Method _isWrapperFor
| Constructor Detail |
|---|
public ConnectionWrapper(DriverInfo driver,
java.sql.Connection connection)
driver - infos on the driverconnection - connection to be wrapped| Method Detail |
|---|
public java.sql.Connection unwrap()
public java.sql.Statement createStatement()
throws java.sql.SQLException
createStatement in interface java.sql.Connectionjava.sql.SQLException
public java.sql.PreparedStatement prepareStatement(java.lang.String s)
throws java.sql.SQLException
prepareStatement in interface java.sql.Connections - SQL query
java.sql.SQLException
public java.sql.CallableStatement prepareCall(java.lang.String s)
throws java.sql.SQLException
prepareCall in interface java.sql.Connections - SQL query
java.sql.SQLException
public java.lang.String nativeSQL(java.lang.String s)
throws java.sql.SQLException
nativeSQL in interface java.sql.Connections - query
java.sql.SQLException
public void setAutoCommit(boolean flag)
throws java.sql.SQLException
setAutoCommit in interface java.sql.Connectionflag - autocommit
java.sql.SQLException
public boolean getAutoCommit()
throws java.sql.SQLException
getAutoCommit in interface java.sql.Connectionjava.sql.SQLException
public void commit()
throws java.sql.SQLException
commit in interface java.sql.Connectionjava.sql.SQLException
public void rollback()
throws java.sql.SQLException
rollback in interface java.sql.Connectionjava.sql.SQLException
public void close()
throws java.sql.SQLException
close in interface java.sql.Connectionjava.sql.SQLException
public boolean isClosed()
throws java.sql.SQLException
isClosed in interface java.sql.Connectionjava.sql.SQLException
public java.sql.DatabaseMetaData getMetaData()
throws java.sql.SQLException
getMetaData in interface java.sql.Connectionjava.sql.SQLException
public void setReadOnly(boolean flag)
throws java.sql.SQLException
setReadOnly in interface java.sql.Connectionflag - read-only
java.sql.SQLException
public boolean isReadOnly()
throws java.sql.SQLException
isReadOnly in interface java.sql.Connectionjava.sql.SQLException
public void setCatalog(java.lang.String s)
throws java.sql.SQLException
setCatalog in interface java.sql.Connections - catalog
java.sql.SQLException
public java.lang.String getCatalog()
throws java.sql.SQLException
getCatalog in interface java.sql.Connectionjava.sql.SQLException
public void setTransactionIsolation(int i)
throws java.sql.SQLException
setTransactionIsolation in interface java.sql.Connectioni - transaction isolation
java.sql.SQLException
public int getTransactionIsolation()
throws java.sql.SQLException
getTransactionIsolation in interface java.sql.Connectionjava.sql.SQLException
public java.sql.SQLWarning getWarnings()
throws java.sql.SQLException
getWarnings in interface java.sql.Connectionjava.sql.SQLException
public void clearWarnings()
throws java.sql.SQLException
clearWarnings in interface java.sql.Connectionjava.sql.SQLException
public java.sql.Statement createStatement(int i,
int j)
throws java.sql.SQLException
createStatement in interface java.sql.Connectioni - result set typej - result set concurrency
java.sql.SQLException
public java.sql.PreparedStatement prepareStatement(java.lang.String s,
int i,
int j)
throws java.sql.SQLException
prepareStatement in interface java.sql.Connections - SQL queryi - result set typej - result set concurrency
java.sql.SQLException
public java.sql.CallableStatement prepareCall(java.lang.String s,
int i,
int j)
throws java.sql.SQLException
prepareCall in interface java.sql.Connections - SQL queryi - result set typej - result set concurrency
java.sql.SQLException
public java.util.Map getTypeMap()
throws java.sql.SQLException
getTypeMap in interface java.sql.Connectionjava.sql.SQLException
public void setTypeMap(java.util.Map map)
throws java.sql.SQLException
setTypeMap in interface java.sql.Connectionmap - type map
java.sql.SQLException
public void setHoldability(int i)
throws java.sql.SQLException
setHoldability in interface java.sql.Connectioni - holdability
java.sql.SQLException
public int getHoldability()
throws java.sql.SQLException
getHoldability in interface java.sql.Connectionjava.sql.SQLException
public java.sql.Savepoint setSavepoint()
throws java.sql.SQLException
setSavepoint in interface java.sql.Connectionjava.sql.SQLException
public java.sql.Savepoint setSavepoint(java.lang.String s)
throws java.sql.SQLException
setSavepoint in interface java.sql.Connections - savepoint name
java.sql.SQLException
public void rollback(java.sql.Savepoint savepoint)
throws java.sql.SQLException
rollback in interface java.sql.Connectionsavepoint - savepoint
java.sql.SQLException
public void releaseSavepoint(java.sql.Savepoint savepoint)
throws java.sql.SQLException
releaseSavepoint in interface java.sql.Connectionsavepoint - savepoint
java.sql.SQLException
public java.sql.Statement createStatement(int i,
int j,
int k)
throws java.sql.SQLException
createStatement in interface java.sql.Connectioni - result set typej - result set concurrencyk - result set holdability
java.sql.SQLException
public java.sql.PreparedStatement prepareStatement(java.lang.String s,
int i,
int j,
int k)
throws java.sql.SQLException
prepareStatement in interface java.sql.Connections - SQL queryi - result set typej - result set concurrencyk - result set holdability
java.sql.SQLException
public java.sql.CallableStatement prepareCall(java.lang.String s,
int i,
int j,
int k)
throws java.sql.SQLException
prepareCall in interface java.sql.Connections - SQL queryi - result set typej - result set concurrencyk - result set holdability
java.sql.SQLException
public java.sql.PreparedStatement prepareStatement(java.lang.String s,
int i)
throws java.sql.SQLException
prepareStatement in interface java.sql.Connections - SQL queryi - autogenerated keys
java.sql.SQLException
public java.sql.PreparedStatement prepareStatement(java.lang.String s,
int[] ai)
throws java.sql.SQLException
prepareStatement in interface java.sql.Connections - SQL queryai - autogenerated keys column indexes
java.sql.SQLException
public java.sql.PreparedStatement prepareStatement(java.lang.String s,
java.lang.String[] as)
throws java.sql.SQLException
prepareStatement in interface java.sql.Connections - SQL queryas - autogenerated keys column names
java.sql.SQLExceptionpublic void enterBusyState()
public void leaveBusyState()
public boolean isBusy()
public long getLastUse()
public long getLastInsertId(java.sql.Statement statement)
throws java.sql.SQLException
statement -
java.sql.SQLExceptionpublic boolean check()
private static java.lang.reflect.Method getConnectionMethod(java.lang.String name,
java.lang.Class[] parameterTypes)
public java.sql.Clob createClob()
throws java.sql.SQLException
createClob in interface java.sql.Connectionjava.sql.SQLException
public java.sql.Blob createBlob()
throws java.sql.SQLException
createBlob in interface java.sql.Connectionjava.sql.SQLException
public java.sql.NClob createNClob()
throws java.sql.SQLException
createNClob in interface java.sql.Connectionjava.sql.SQLException
public java.sql.SQLXML createSQLXML()
throws java.sql.SQLException
createSQLXML in interface java.sql.Connectionjava.sql.SQLException
public boolean isValid(int timeout)
throws java.sql.SQLException
isValid in interface java.sql.Connectionjava.sql.SQLException
public void setClientInfo(java.lang.String name,
java.lang.String value)
setClientInfo in interface java.sql.Connectionpublic void setClientInfo(java.util.Properties properties)
setClientInfo in interface java.sql.Connection
public java.util.Properties getClientInfo()
throws java.sql.SQLException
getClientInfo in interface java.sql.Connectionjava.sql.SQLException
public java.lang.String getClientInfo(java.lang.String name)
throws java.sql.SQLException
getClientInfo in interface java.sql.Connectionjava.sql.SQLException
public java.sql.Array createArrayOf(java.lang.String typeName,
java.lang.Object[] elements)
throws java.sql.SQLException
createArrayOf in interface java.sql.Connectionjava.sql.SQLException
public java.sql.Struct createStruct(java.lang.String typeName,
java.lang.Object[] attributes)
throws java.sql.SQLException
createStruct in interface java.sql.Connectionjava.sql.SQLException
public boolean isWrapperFor(java.lang.Class<?> iface)
throws java.sql.SQLException
isWrapperFor in interface java.sql.Wrapperjava.sql.SQLException
public <T> T unwrap(java.lang.Class<T> iface)
throws java.sql.SQLException
unwrap in interface java.sql.Wrapperjava.sql.SQLException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||