com.ibatis.common.jdbc
Class SimpleDataSource.SimplePooledConnection

java.lang.Object
  extended by com.ibatis.common.jdbc.SimpleDataSource.SimplePooledConnection
所有已实现接口:
java.lang.reflect.InvocationHandler
封闭类:
SimpleDataSource

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

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


构造器摘要
SimpleDataSource.SimplePooledConnection(java.sql.Connection connection, SimpleDataSource dataSource)
          Constructor for SimplePooledConnection that uses the Connection and SimpleDataSource passed in
 
方法摘要
 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()
           
 java.sql.SQLWarning getWarnings()
           
 int hashCode()
           
 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 implementation.
 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)
           
 
类方法继承: java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

构造器详细信息

SimpleDataSource.SimplePooledConnection

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

参数:
connection - - the connection that is to be presented as a pooled connection
dataSource - - the dataSource that the connection is from
方法详细信息

invalidate

public void invalidate()
Invalidates the connection


isValid

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

返回:
True if the connection is usable

getRealConnection

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

返回:
The connection

getProxyConnection

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

返回:
The proxy

getRealHashCode

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

返回:
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)

返回:
The connection type

setConnectionTypeCode

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

参数:
connectionTypeCode - - the connection type

getCreatedTimestamp

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

返回:
The creation timestamp

setCreatedTimestamp

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

参数:
createdTimestamp - - the timestamp

getLastUsedTimestamp

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

返回:
- the timestamp

setLastUsedTimestamp

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

参数:
lastUsedTimestamp - - the timestamp

getTimeElapsedSinceLastUse

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

返回:
- the time since the last use

getAge

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

返回:
the age

getCheckoutTimestamp

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

返回:
the timestamp

setCheckoutTimestamp

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

参数:
timestamp - the timestamp

getCheckoutTime

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

返回:
the time

hashCode

public int hashCode()
重写:
hashCode in class java.lang.Object

equals

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

重写:
equals in class java.lang.Object
参数:
obj - - the other connection to test for equality
另请参见:
Object.equals(java.lang.Object)

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 implementation.

规范说明:
invoke in interface java.lang.reflect.InvocationHandler
参数:
proxy - - not used
method - - the method to be executed
args - - the parameters to be passed to the method
抛出异常:
java.lang.Throwable
另请参见:
InvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])

createStatement

public java.sql.Statement createStatement()
                                   throws java.sql.SQLException
抛出异常:
java.sql.SQLException

prepareStatement

public java.sql.PreparedStatement prepareStatement(java.lang.String sql)
                                            throws java.sql.SQLException
抛出异常:
java.sql.SQLException

prepareCall

public java.sql.CallableStatement prepareCall(java.lang.String sql)
                                       throws java.sql.SQLException
抛出异常:
java.sql.SQLException

nativeSQL

public java.lang.String nativeSQL(java.lang.String sql)
                           throws java.sql.SQLException
抛出异常:
java.sql.SQLException

setAutoCommit

public void setAutoCommit(boolean autoCommit)
                   throws java.sql.SQLException
抛出异常:
java.sql.SQLException

getAutoCommit

public boolean getAutoCommit()
                      throws java.sql.SQLException
抛出异常:
java.sql.SQLException

commit

public void commit()
            throws java.sql.SQLException
抛出异常:
java.sql.SQLException

rollback

public void rollback()
              throws java.sql.SQLException
抛出异常:
java.sql.SQLException

close

public void close()
           throws java.sql.SQLException
抛出异常:
java.sql.SQLException

isClosed

public boolean isClosed()
                 throws java.sql.SQLException
抛出异常:
java.sql.SQLException

getMetaData

public java.sql.DatabaseMetaData getMetaData()
                                      throws java.sql.SQLException
抛出异常:
java.sql.SQLException

setReadOnly

public void setReadOnly(boolean readOnly)
                 throws java.sql.SQLException
抛出异常:
java.sql.SQLException

isReadOnly

public boolean isReadOnly()
                   throws java.sql.SQLException
抛出异常:
java.sql.SQLException

setCatalog

public void setCatalog(java.lang.String catalog)
                throws java.sql.SQLException
抛出异常:
java.sql.SQLException

getCatalog

public java.lang.String getCatalog()
                            throws java.sql.SQLException
抛出异常:
java.sql.SQLException

setTransactionIsolation

public void setTransactionIsolation(int level)
                             throws java.sql.SQLException
抛出异常:
java.sql.SQLException

getTransactionIsolation

public int getTransactionIsolation()
                            throws java.sql.SQLException
抛出异常:
java.sql.SQLException

getWarnings

public java.sql.SQLWarning getWarnings()
                                throws java.sql.SQLException
抛出异常:
java.sql.SQLException

clearWarnings

public void clearWarnings()
                   throws java.sql.SQLException
抛出异常:
java.sql.SQLException

createStatement

public java.sql.Statement createStatement(int resultSetType,
                                          int resultSetConcurrency)
                                   throws java.sql.SQLException
抛出异常:
java.sql.SQLException

prepareStatement

public java.sql.PreparedStatement prepareStatement(java.lang.String sql,
                                                   int resultSetType,
                                                   int resultSetConcurrency)
                                            throws java.sql.SQLException
抛出异常:
java.sql.SQLException

prepareCall

public java.sql.CallableStatement prepareCall(java.lang.String sql,
                                              int resultSetType,
                                              int resultSetConcurrency)
                                       throws java.sql.SQLException
抛出异常:
java.sql.SQLException

getTypeMap

public java.util.Map getTypeMap()
                         throws java.sql.SQLException
抛出异常:
java.sql.SQLException

setTypeMap

public void setTypeMap(java.util.Map map)
                throws java.sql.SQLException
抛出异常:
java.sql.SQLException

setHoldability

public void setHoldability(int holdability)
                    throws java.sql.SQLException
抛出异常:
java.sql.SQLException

getHoldability

public int getHoldability()
                   throws java.sql.SQLException
抛出异常:
java.sql.SQLException

setSavepoint

public java.sql.Savepoint setSavepoint()
                                throws java.sql.SQLException
抛出异常:
java.sql.SQLException

setSavepoint

public java.sql.Savepoint setSavepoint(java.lang.String name)
                                throws java.sql.SQLException
抛出异常:
java.sql.SQLException

rollback

public void rollback(java.sql.Savepoint savepoint)
              throws java.sql.SQLException
抛出异常:
java.sql.SQLException

releaseSavepoint

public void releaseSavepoint(java.sql.Savepoint savepoint)
                      throws java.sql.SQLException
抛出异常:
java.sql.SQLException

createStatement

public java.sql.Statement createStatement(int resultSetType,
                                          int resultSetConcurrency,
                                          int resultSetHoldability)
                                   throws java.sql.SQLException
抛出异常:
java.sql.SQLException

prepareStatement

public java.sql.PreparedStatement prepareStatement(java.lang.String sql,
                                                   int resultSetType,
                                                   int resultSetConcurrency,
                                                   int resultSetHoldability)
                                            throws java.sql.SQLException
抛出异常:
java.sql.SQLException

prepareCall

public java.sql.CallableStatement prepareCall(java.lang.String sql,
                                              int resultSetType,
                                              int resultSetConcurrency,
                                              int resultSetHoldability)
                                       throws java.sql.SQLException
抛出异常:
java.sql.SQLException

prepareStatement

public java.sql.PreparedStatement prepareStatement(java.lang.String sql,
                                                   int autoGeneratedKeys)
                                            throws java.sql.SQLException
抛出异常:
java.sql.SQLException

prepareStatement

public java.sql.PreparedStatement prepareStatement(java.lang.String sql,
                                                   int[] columnIndexes)
                                            throws java.sql.SQLException
抛出异常:
java.sql.SQLException

prepareStatement

public java.sql.PreparedStatement prepareStatement(java.lang.String sql,
                                                   java.lang.String[] columnNames)
                                            throws java.sql.SQLException
抛出异常:
java.sql.SQLException