SolarMetric Kodo JDO 2.4.3 generated on March 27 2003

com.solarmetric.datasource
Class ConnectionWrapper

java.lang.Object
  |
  +--com.solarmetric.datasource.ConnectionWrapper
All Implemented Interfaces:
Comparable, Connection

public class ConnectionWrapper
extends Object
implements Connection, Comparable

Wrapper around an existing connection. Subclasses can override the methods whose behavior they mean to change. The equals and hashcode methods pass through to the base underlying data store connection.


Inner Class Summary
static class ConnectionWrapper.Statistics
           
 
Fields inherited from interface java.sql.Connection
TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE
 
Constructor Summary
ConnectionWrapper(DataSourceImpl ds, Connection conn)
           
 
Method Summary
 void addError(Exception e)
           
protected  void checkClosed()
           
 void clearWarnings()
           
 void close()
           
 void commit()
           
 int compareTo(Object other)
          A subclass of this method might want to override this in order to appear at a higher position on the sorted pool.
 Statement createStatement()
           
 Statement createStatement(int type, int concurrency)
           
 Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability)
           
 boolean equals(Object other)
           
protected  void finalize()
           
 boolean getAutoCommit()
           
 Connection getBaseConnection()
          Return the base underlying data store connection.
 String getCatalog()
           
 Connection getConnection()
          Return the wrapped connection.
 DataSourceImpl getDataSource()
           
 int getErrorCount()
           
 int getHoldability()
           
 long getLastConnectionTestTime()
          The time in milliseconds when this connection was last tested.
 DatabaseMetaData getMetaData()
           
 int getTransactionIsolation()
           
 Map getTypeMap()
           
 SQLWarning getWarnings()
           
 int hashCode()
           
 boolean isClosed()
           
 boolean isReadOnly()
           
 String nativeSQL(String str)
           
 CallableStatement prepareCall(String str)
           
 CallableStatement prepareCall(String str, int i1, int i2)
           
 CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)
           
 PreparedStatement prepareStatement(String sql)
           
 PreparedStatement prepareStatement(String sql, int autoGeneratedKeys)
           
 PreparedStatement prepareStatement(String sql, int[] columnIndexes)
           
 PreparedStatement prepareStatement(String sql, int type, int concur)
           
 PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)
           
 PreparedStatement prepareStatement(String sql, String[] columnNames)
           
 void releaseSavepoint(Savepoint savepoint)
           
 void rollback()
           
 void rollback(Savepoint savepoint)
           
 void setAutoCommit(boolean bool)
           
 void setCatalog(String str)
           
 void setHoldability(int holdability)
           
 void setLastConnectionTestTime(long time)
          The time in milliseconds when this connection was last tested.
 void setReadOnly(boolean bool)
           
 Savepoint setSavepoint()
           
 Savepoint setSavepoint(String savepoint)
           
 void setTransactionIsolation(int i)
           
 void setTypeMap(Map map)
           
 String toString()
           
 StringBuffer toString(StringBuffer buffer)
           
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ConnectionWrapper

public ConnectionWrapper(DataSourceImpl ds,
                         Connection conn)
Method Detail

finalize

protected void finalize()
                 throws Throwable
Overrides:
finalize in class Object

getDataSource

public DataSourceImpl getDataSource()

getLastConnectionTestTime

public long getLastConnectionTestTime()
The time in milliseconds when this connection was last tested. This can be used in conjunction with DataSourceImpl.getConnectionTestTimeout() to implement an efficient mechanism to ensure that a wrapped connection really is open.

setLastConnectionTestTime

public void setLastConnectionTestTime(long time)
The time in milliseconds when this connection was last tested. This can be used in conjunction with DataSourceImpl.getConnectionTestTimeout() to implement an efficient mechanism to ensure that a wrapped connection really is open.

addError

public void addError(Exception e)

getErrorCount

public int getErrorCount()

getConnection

public Connection getConnection()
Return the wrapped connection.

getBaseConnection

public Connection getBaseConnection()
Return the base underlying data store connection.

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object other)
Overrides:
equals in class Object

createStatement

public Statement createStatement()
                          throws SQLException
Specified by:
createStatement in interface Connection

prepareStatement

public PreparedStatement prepareStatement(String sql)
                                   throws SQLException
Specified by:
prepareStatement in interface Connection

prepareCall

public CallableStatement prepareCall(String str)
                              throws SQLException
Specified by:
prepareCall in interface Connection

nativeSQL

public String nativeSQL(String str)
                 throws SQLException
Specified by:
nativeSQL in interface Connection

setAutoCommit

public void setAutoCommit(boolean bool)
                   throws SQLException
Specified by:
setAutoCommit in interface Connection

getAutoCommit

public boolean getAutoCommit()
                      throws SQLException
Specified by:
getAutoCommit in interface Connection

commit

public void commit()
            throws SQLException
Specified by:
commit in interface Connection

rollback

public void rollback()
              throws SQLException
Specified by:
rollback in interface Connection

close

public void close()
           throws SQLException
Specified by:
close in interface Connection

isClosed

public boolean isClosed()
                 throws SQLException
Specified by:
isClosed in interface Connection

checkClosed

protected void checkClosed()
                    throws SQLException

getMetaData

public DatabaseMetaData getMetaData()
                             throws SQLException
Specified by:
getMetaData in interface Connection

setReadOnly

public void setReadOnly(boolean bool)
                 throws SQLException
Specified by:
setReadOnly in interface Connection

isReadOnly

public boolean isReadOnly()
                   throws SQLException
Specified by:
isReadOnly in interface Connection

setCatalog

public void setCatalog(String str)
                throws SQLException
Specified by:
setCatalog in interface Connection

getCatalog

public String getCatalog()
                  throws SQLException
Specified by:
getCatalog in interface Connection

setTransactionIsolation

public void setTransactionIsolation(int i)
                             throws SQLException
Specified by:
setTransactionIsolation in interface Connection

getTransactionIsolation

public int getTransactionIsolation()
                            throws SQLException
Specified by:
getTransactionIsolation in interface Connection

getWarnings

public SQLWarning getWarnings()
                       throws SQLException
Specified by:
getWarnings in interface Connection

clearWarnings

public void clearWarnings()
                   throws SQLException
Specified by:
clearWarnings in interface Connection

createStatement

public Statement createStatement(int type,
                                 int concurrency)
                          throws SQLException
Specified by:
createStatement in interface Connection

prepareStatement

public PreparedStatement prepareStatement(String sql,
                                          int type,
                                          int concur)
                                   throws SQLException
Specified by:
prepareStatement in interface Connection

prepareCall

public CallableStatement prepareCall(String str,
                                     int i1,
                                     int i2)
                              throws SQLException
Specified by:
prepareCall in interface Connection

getTypeMap

public Map getTypeMap()
               throws SQLException
Specified by:
getTypeMap in interface Connection

setTypeMap

public void setTypeMap(Map map)
                throws SQLException
Specified by:
setTypeMap in interface Connection

setHoldability

public void setHoldability(int holdability)
                    throws SQLException

getHoldability

public int getHoldability()
                   throws SQLException

setSavepoint

public Savepoint setSavepoint()
                       throws SQLException

setSavepoint

public Savepoint setSavepoint(String savepoint)
                       throws SQLException

rollback

public void rollback(Savepoint savepoint)
              throws SQLException

releaseSavepoint

public void releaseSavepoint(Savepoint savepoint)
                      throws SQLException

createStatement

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

prepareStatement

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

prepareCall

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

prepareStatement

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

prepareStatement

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

prepareStatement

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

compareTo

public int compareTo(Object other)
A subclass of this method might want to override this in order to appear at a higher position on the sorted pool.
Specified by:
compareTo in interface Comparable

toString

public StringBuffer toString(StringBuffer buffer)

toString

public String toString()
Overrides:
toString in class Object

SolarMetric Kodo JDO 2.4.3 generated on March 27 2003

Copyright 2001,2002 SolarMetric, Inc. All Rights Reserved.