com.ibatis.common.jdbc

Class SimpleDataSource.SimplePooledConnection

public static class SimpleDataSource.SimplePooledConnection extends Object implements InvocationHandler

--------------------------------------------------------------------------------------- SimplePooledConnection ---------------------------------------------------------------------------------------
Constructor Summary
SimplePooledConnection(Connection connection, SimpleDataSource dataSource)
Constructor for SimplePooledConnection that uses the Connection and SimpleDataSource passed in
Method Summary
voidclearWarnings()
voidclose()
voidcommit()
StatementcreateStatement()
StatementcreateStatement(int resultSetType, int resultSetConcurrency)
StatementcreateStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability)
booleanequals(Object obj)
Allows comparing this connection to another
longgetAge()
Getter for the age of the connection
booleangetAutoCommit()
StringgetCatalog()
longgetCheckoutTime()
Getter for the time that this connection has been checked out
longgetCheckoutTimestamp()
Getter for the timestamp that this connection was checked out
intgetConnectionTypeCode()
Getter for the connection type (based on url + user + password)
longgetCreatedTimestamp()
Getter for the time that the connection was created
intgetHoldability()
longgetLastUsedTimestamp()
Getter for the time that the connection was last used
DatabaseMetaDatagetMetaData()
ConnectiongetProxyConnection()
Getter for the proxy for the connection
ConnectiongetRealConnection()
Getter for the *real* connection that this wraps
intgetRealHashCode()
Gets the hashcode of the real connection (or 0 if it is null)
longgetTimeElapsedSinceLastUse()
Getter for the time since this connection was last used
intgetTransactionIsolation()
MapgetTypeMap()
SQLWarninggetWarnings()
inthashCode()
voidinvalidate()
Invalidates the connection
Objectinvoke(Object proxy, Method method, Object[] args)
Required for InvocationHandler implementation.
booleanisClosed()
booleanisReadOnly()
booleanisValid()
Method to see if the connection is usable
StringnativeSQL(String sql)
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)
voidsetCheckoutTimestamp(long timestamp)
Setter for the timestamp that this connection was checked out
voidsetConnectionTypeCode(int connectionTypeCode)
Setter for the connection type
voidsetCreatedTimestamp(long createdTimestamp)
Setter for the time that the connection was created
voidsetHoldability(int holdability)
voidsetLastUsedTimestamp(long lastUsedTimestamp)
Setter for the time that the connection was last used
voidsetReadOnly(boolean readOnly)
SavepointsetSavepoint()
SavepointsetSavepoint(String name)
voidsetTransactionIsolation(int level)
voidsetTypeMap(Map map)

Constructor Detail

SimplePooledConnection

public SimplePooledConnection(Connection connection, SimpleDataSource dataSource)
Constructor for SimplePooledConnection that uses the Connection and SimpleDataSource passed in

Parameters: connection - the connection that is to be presented as a pooled connection dataSource - the dataSource that the connection is from

Method Detail

clearWarnings

public void clearWarnings()

close

public void close()

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)

equals

public boolean equals(Object obj)
Allows comparing this connection to another

Parameters: obj - the other connection to test for equality

See Also: java.lang.Object#equals(java.lang.Object)

getAge

public long getAge()
Getter for the age of the connection

Returns: the age

getAutoCommit

public boolean getAutoCommit()

getCatalog

public String getCatalog()

getCheckoutTime

public long getCheckoutTime()
Getter for the time that this connection has been checked out

Returns: the time

getCheckoutTimestamp

public long getCheckoutTimestamp()
Getter for the timestamp that this connection was checked out

Returns: the timestamp

getConnectionTypeCode

public int getConnectionTypeCode()
Getter for the connection type (based on url + user + password)

Returns: The connection type

getCreatedTimestamp

public long getCreatedTimestamp()
Getter for the time that the connection was created

Returns: The creation timestamp

getHoldability

public int getHoldability()

getLastUsedTimestamp

public long getLastUsedTimestamp()
Getter for the time that the connection was last used

Returns: - the timestamp

getMetaData

public DatabaseMetaData getMetaData()

getProxyConnection

public Connection getProxyConnection()
Getter for the proxy for the connection

Returns: The proxy

getRealConnection

public Connection getRealConnection()
Getter for the *real* connection that this wraps

Returns: The connection

getRealHashCode

public int getRealHashCode()
Gets the hashcode of the real connection (or 0 if it is null)

Returns: The hashcode of the real connection (or 0 if it is null)

getTimeElapsedSinceLastUse

public long getTimeElapsedSinceLastUse()
Getter for the time since this connection was last used

Returns: - the time since the last use

getTransactionIsolation

public int getTransactionIsolation()

getTypeMap

public Map getTypeMap()

getWarnings

public SQLWarning getWarnings()

hashCode

public int hashCode()

invalidate

public void invalidate()
Invalidates the connection

invoke

public Object invoke(Object proxy, Method method, Object[] args)
Required for InvocationHandler implementation.

Parameters: proxy - not used method - the method to be executed args - the parameters to be passed to the method

See Also: java.lang.reflect.InvocationHandler#invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])

isClosed

public boolean isClosed()

isReadOnly

public boolean isReadOnly()

isValid

public boolean isValid()
Method to see if the connection is usable

Returns: True if the connection is usable

nativeSQL

public String nativeSQL(String sql)

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)

setCheckoutTimestamp

public void setCheckoutTimestamp(long timestamp)
Setter for the timestamp that this connection was checked out

Parameters: timestamp the timestamp

setConnectionTypeCode

public void setConnectionTypeCode(int connectionTypeCode)
Setter for the connection type

Parameters: connectionTypeCode - the connection type

setCreatedTimestamp

public void setCreatedTimestamp(long createdTimestamp)
Setter for the time that the connection was created

Parameters: createdTimestamp - the timestamp

setHoldability

public void setHoldability(int holdability)

setLastUsedTimestamp

public void setLastUsedTimestamp(long lastUsedTimestamp)
Setter for the time that the connection was last used

Parameters: lastUsedTimestamp - the timestamp

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)
Copyright © 2011. All Rights Reserved.