Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.ibatis.common.jdbc
Class SimpleDataSource.SimplePooledConnection  view SimpleDataSource.SimplePooledConnection download SimpleDataSource.SimplePooledConnection.java

java.lang.Object
  extended bycom.ibatis.common.jdbc.SimpleDataSource.SimplePooledConnection
All Implemented Interfaces:
java.lang.reflect.InvocationHandler
Enclosing class:
SimpleDataSource

private static class SimpleDataSource.SimplePooledConnection
extends java.lang.Object
implements java.lang.reflect.InvocationHandler

--------------------------------------------------------------------------------------- SimplePooledConnection ---------------------------------------------------------------------------------------


Field Summary
private  long checkoutTimestamp
           
private static java.lang.String CLOSE
           
private  int connectionTypeCode
           
private  long createdTimestamp
           
private  SimpleDataSource dataSource
           
private  int hashCode
           
private static java.lang.Class[] IFACES
           
private  long lastUsedTimestamp
           
private  java.sql.Connection proxyConnection
           
private  java.sql.Connection realConnection
           
private  boolean valid
           
 
Constructor Summary
SimpleDataSource.SimplePooledConnection(java.sql.Connection connection, SimpleDataSource dataSource)
          Constructor for SimplePooledConnection that uses the Connection and SimpleDataSource passed in
 
Method Summary
 void clearWarnings()
           
 void close()
           
 void commit()
           
 java.sql.Statement createStatement()
           
 java.sql.Statement createStatement(int resultSetType, int resultSetConcurrency)
           
 java.sql.Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability)
           
 boolean equals(java.lang.Object obj)
          Allows comparing this connection to another
 long getAge()
          Getter for the age of the connection
 boolean getAutoCommit()
           
 java.lang.String getCatalog()
           
 long getCheckoutTime()
          Getter for the time that this connection has been checked out
 long getCheckoutTimestamp()
          Getter for the timestamp that this connection was checked out
 int getConnectionTypeCode()
          Getter for the connection type (based on url + user + password)
 long getCreatedTimestamp()
          Getter for the time that the connection was created
 int getHoldability()
           
 long getLastUsedTimestamp()
          Getter for the time that the connection was last used
 java.sql.DatabaseMetaData getMetaData()
           
 java.sql.Connection getProxyConnection()
          Getter for the proxy for the connection
 java.sql.Connection getRealConnection()
          Getter for the *real* connection that this wraps
 int getRealHashCode()
          Gets the hashcode of the real connection (or 0 if it is null)
 long getTimeElapsedSinceLastUse()
          Getter for the time since this connection was last used
 int getTransactionIsolation()
           
 java.util.Map getTypeMap()
           
private  java.sql.Connection getValidConnection()
           
 java.sql.SQLWarning getWarnings()
           
 int hashCode()
          Get a value that represents this Object, as uniquely as possible within the confines of an int.
 void invalidate()
          Invalidates the connection
 java.lang.Object invoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args)
          Required for InvocationHandler inplementaion.
 boolean isClosed()
           
 boolean isReadOnly()
           
 boolean isValid()
          Method to see if the connection is usable
 java.lang.String nativeSQL(java.lang.String sql)
           
 java.sql.CallableStatement prepareCall(java.lang.String sql)
           
 java.sql.CallableStatement prepareCall(java.lang.String sql, int resultSetType, int resultSetConcurrency)
           
 java.sql.CallableStatement prepareCall(java.lang.String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)
           
 java.sql.PreparedStatement prepareStatement(java.lang.String sql)
           
 java.sql.PreparedStatement prepareStatement(java.lang.String sql, int autoGeneratedKeys)
           
 java.sql.PreparedStatement prepareStatement(java.lang.String sql, int[] columnIndexes)
           
 java.sql.PreparedStatement prepareStatement(java.lang.String sql, int resultSetType, int resultSetConcurrency)
           
 java.sql.PreparedStatement prepareStatement(java.lang.String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)
           
 java.sql.PreparedStatement prepareStatement(java.lang.String sql, java.lang.String[] columnNames)
           
 void releaseSavepoint(java.sql.Savepoint savepoint)
           
 void rollback()
           
 void rollback(java.sql.Savepoint savepoint)
           
 void setAutoCommit(boolean autoCommit)
           
 void setCatalog(java.lang.String catalog)
           
 void setCheckoutTimestamp(long timestamp)
          Setter for the timestamp that this connection was checked out
 void setConnectionTypeCode(int connectionTypeCode)
          Setter for the connection type
 void setCreatedTimestamp(long createdTimestamp)
          Setter for the time that the connection was created
 void setHoldability(int holdability)
           
 void setLastUsedTimestamp(long lastUsedTimestamp)
          Setter for the time that the connection was last used
 void setReadOnly(boolean readOnly)
           
 java.sql.Savepoint setSavepoint()
           
 java.sql.Savepoint setSavepoint(java.lang.String name)
           
 void setTransactionIsolation(int level)
           
 void setTypeMap(java.util.Map map)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLOSE

private static final java.lang.String CLOSE
See Also:
Constant Field Values

IFACES

private static final java.lang.Class[] IFACES

hashCode

private int hashCode

dataSource

private SimpleDataSource dataSource

realConnection

private java.sql.Connection realConnection

proxyConnection

private java.sql.Connection proxyConnection

checkoutTimestamp

private long checkoutTimestamp

createdTimestamp

private long createdTimestamp

lastUsedTimestamp

private long lastUsedTimestamp

connectionTypeCode

private int connectionTypeCode

valid

private boolean valid
Constructor Detail

SimpleDataSource.SimplePooledConnection

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

Method Detail

invalidate

public void invalidate()
Invalidates the connection


isValid

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


getRealConnection

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


getProxyConnection

public java.sql.Connection getProxyConnection()
Getter for the proxy for the connection


getRealHashCode

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


getConnectionTypeCode

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


setConnectionTypeCode

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


getCreatedTimestamp

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


setCreatedTimestamp

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


getLastUsedTimestamp

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


setLastUsedTimestamp

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


getTimeElapsedSinceLastUse

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


getAge

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


getCheckoutTimestamp

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


setCheckoutTimestamp

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


getCheckoutTime

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


getValidConnection

private java.sql.Connection getValidConnection()

hashCode

public int hashCode()
Description copied from class: java.lang.Object
Get a value that represents this Object, as uniquely as possible within the confines of an int.

There are some requirements on this method which subclasses must follow:

  • Semantic equality implies identical hashcodes. In other words, if a.equals(b) is true, then a.hashCode() == b.hashCode() must be as well. However, the reverse is not necessarily true, and two objects may have the same hashcode without being equal.
  • It must be consistent. Whichever value o.hashCode() returns on the first invocation must be the value returned on all later invocations as long as the object exists. Notice, however, that the result of hashCode may change between separate executions of a Virtual Machine, because it is not invoked on the same object.

Notice that since hashCode is used in java.util.Hashtable and other hashing classes, a poor implementation will degrade the performance of hashing (so don't blindly implement it as returning a constant!). Also, if calculating the hash is time-consuming, a class may consider caching the results.

The default implementation returns System.identityHashCode(this)


equals

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


invoke

public java.lang.Object invoke(java.lang.Object proxy,
                               java.lang.reflect.Method method,
                               java.lang.Object[] args)
                        throws java.lang.Throwable
Required for InvocationHandler inplementaion.

Specified by:
invoke in interface java.lang.reflect.InvocationHandler

createStatement

public java.sql.Statement createStatement()
                                   throws java.sql.SQLException

prepareStatement

public java.sql.PreparedStatement prepareStatement(java.lang.String sql)
                                            throws java.sql.SQLException

prepareCall

public java.sql.CallableStatement prepareCall(java.lang.String sql)
                                       throws java.sql.SQLException

nativeSQL

public java.lang.String nativeSQL(java.lang.String sql)
                           throws java.sql.SQLException

setAutoCommit

public void setAutoCommit(boolean autoCommit)
                   throws java.sql.SQLException

getAutoCommit

public boolean getAutoCommit()
                      throws java.sql.SQLException

commit

public void commit()
            throws java.sql.SQLException

rollback

public void rollback()
              throws java.sql.SQLException

close

public void close()
           throws java.sql.SQLException

isClosed

public boolean isClosed()
                 throws java.sql.SQLException

getMetaData

public java.sql.DatabaseMetaData getMetaData()
                                      throws java.sql.SQLException

setReadOnly

public void setReadOnly(boolean readOnly)
                 throws java.sql.SQLException

isReadOnly

public boolean isReadOnly()
                   throws java.sql.SQLException

setCatalog

public void setCatalog(java.lang.String catalog)
                throws java.sql.SQLException

getCatalog

public java.lang.String getCatalog()
                            throws java.sql.SQLException

setTransactionIsolation

public void setTransactionIsolation(int level)
                             throws java.sql.SQLException

getTransactionIsolation

public int getTransactionIsolation()
                            throws java.sql.SQLException

getWarnings

public java.sql.SQLWarning getWarnings()
                                throws java.sql.SQLException

clearWarnings

public void clearWarnings()
                   throws java.sql.SQLException

createStatement

public java.sql.Statement createStatement(int resultSetType,
                                          int resultSetConcurrency)
                                   throws java.sql.SQLException

prepareStatement

public java.sql.PreparedStatement prepareStatement(java.lang.String sql,
                                                   int resultSetType,
                                                   int resultSetConcurrency)
                                            throws java.sql.SQLException

prepareCall

public java.sql.CallableStatement prepareCall(java.lang.String sql,
                                              int resultSetType,
                                              int resultSetConcurrency)
                                       throws java.sql.SQLException

getTypeMap

public java.util.Map getTypeMap()
                         throws java.sql.SQLException

setTypeMap

public void setTypeMap(java.util.Map map)
                throws java.sql.SQLException

setHoldability

public void setHoldability(int holdability)
                    throws java.sql.SQLException

getHoldability

public int getHoldability()
                   throws java.sql.SQLException

setSavepoint

public java.sql.Savepoint setSavepoint()
                                throws java.sql.SQLException

setSavepoint

public java.sql.Savepoint setSavepoint(java.lang.String name)
                                throws java.sql.SQLException

rollback

public void rollback(java.sql.Savepoint savepoint)
              throws java.sql.SQLException

releaseSavepoint

public void releaseSavepoint(java.sql.Savepoint savepoint)
                      throws java.sql.SQLException

createStatement

public java.sql.Statement createStatement(int resultSetType,
                                          int resultSetConcurrency,
                                          int resultSetHoldability)
                                   throws java.sql.SQLException

prepareStatement

public java.sql.PreparedStatement prepareStatement(java.lang.String sql,
                                                   int resultSetType,
                                                   int resultSetConcurrency,
                                                   int resultSetHoldability)
                                            throws java.sql.SQLException

prepareCall

public java.sql.CallableStatement prepareCall(java.lang.String sql,
                                              int resultSetType,
                                              int resultSetConcurrency,
                                              int resultSetHoldability)
                                       throws java.sql.SQLException

prepareStatement

public java.sql.PreparedStatement prepareStatement(java.lang.String sql,
                                                   int autoGeneratedKeys)
                                            throws java.sql.SQLException

prepareStatement

public java.sql.PreparedStatement prepareStatement(java.lang.String sql,
                                                   int[] columnIndexes)
                                            throws java.sql.SQLException

prepareStatement

public java.sql.PreparedStatement prepareStatement(java.lang.String sql,
                                                   java.lang.String[] columnNames)
                                            throws java.sql.SQLException