com.metamatrix.common.pooling.jdbc
Class JDBCConnectionResource

java.lang.Object
  extended by com.metamatrix.common.pooling.impl.BaseResource
      extended by com.metamatrix.common.pooling.jdbc.JDBCConnectionResource
All Implemented Interfaces:
Resource, java.sql.Connection, java.sql.Wrapper

public class JDBCConnectionResource
extends BaseResource
implements java.sql.Connection


Field Summary
static java.lang.String AUTOCOMMIT
          The environment property name that indicates what the autocommit on the connection should be set to.
static java.lang.String DATABASE
          The environment property name for the database name.
static java.lang.String DRIVER
          The environment property name for the class of the driver.
static java.lang.String PASSWORD
          The environment property name for the password that is to be used for connecting to the metadata store.
static java.lang.String PROTOCOL
          The environment property name for the protocol that is to be used.
static java.lang.String SQL_TRACING_PROPERTY
           
static java.lang.String USERNAME
          The environment property name for the username that is to be used for connecting to the metadata store.
 
Fields inherited from class com.metamatrix.common.pooling.impl.BaseResource
LOG_CONTEXT
 
Fields inherited from interface java.sql.Connection
TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE
 
Constructor Summary
JDBCConnectionResource(java.sql.Connection conn, JDBCPlatform jdbcPlatform, java.lang.Long id)
           
 
Method Summary
protected  boolean checkIsResourceAlive()
          This method is invoked when BaseResource.isAlive is called to determine if the resource is operating normally.
 void clearWarnings()
           
 void close()
           
 void commit()
           
 java.sql.Array createArrayOf(java.lang.String arg0, java.lang.Object[] arg1)
           
 java.sql.Blob createBlob()
           
 java.sql.Clob createClob()
           
 java.sql.NClob createNClob()
           
 java.sql.SQLXML createSQLXML()
           
 java.sql.Statement createStatement()
           
 java.sql.Statement createStatement(int arg0, int arg1)
           
 java.sql.Statement createStatement(int arg0, int arg1, int arg2)
           
 java.sql.Struct createStruct(java.lang.String arg0, java.lang.Object[] arg1)
           
 boolean getAutoCommit()
           
 java.lang.String getCatalog()
           
 java.util.Properties getClientInfo()
           
 java.lang.String getClientInfo(java.lang.String arg0)
           
protected  java.sql.Connection getConnection()
           
 int getHoldability()
           
 java.sql.DatabaseMetaData getMetaData()
           
 JDBCPlatform getPlatform()
           
 java.lang.Long getResourceID()
           
 int getTransactionIsolation()
           
 java.util.Map<java.lang.String,java.lang.Class<?>> getTypeMap()
           
 java.sql.SQLWarning getWarnings()
           
 boolean isReadOnly()
           
 boolean isValid(int arg0)
           
 boolean isWrapperFor(java.lang.Class<?> arg0)
           
 java.lang.String nativeSQL(java.lang.String arg0)
           
protected  void performInit()
          Perform initialization allows for additional initialization by the implementor before the resource object is made avaialable for use.
 java.sql.CallableStatement prepareCall(java.lang.String arg0)
           
 java.sql.CallableStatement prepareCall(java.lang.String arg0, int arg1, int arg2)
           
 java.sql.CallableStatement prepareCall(java.lang.String arg0, int arg1, int arg2, int arg3)
           
 java.sql.PreparedStatement prepareStatement(java.lang.String arg0)
           
 java.sql.PreparedStatement prepareStatement(java.lang.String arg0, int arg1)
           
 java.sql.PreparedStatement prepareStatement(java.lang.String arg0, int[] arg1)
           
 java.sql.PreparedStatement prepareStatement(java.lang.String arg0, int arg1, int arg2)
           
 java.sql.PreparedStatement prepareStatement(java.lang.String arg0, int arg1, int arg2, int arg3)
           
 java.sql.PreparedStatement prepareStatement(java.lang.String arg0, java.lang.String[] arg1)
           
 void releaseSavepoint(java.sql.Savepoint arg0)
           
 void rollback()
           
 void rollback(java.sql.Savepoint arg0)
           
 void setAutoCommit(boolean arg0)
           
 void setCatalog(java.lang.String arg0)
           
 void setClientInfo(java.util.Properties arg0)
           
 void setClientInfo(java.lang.String arg0, java.lang.String arg1)
           
 void setHoldability(int arg0)
           
 void setReadOnly(boolean arg0)
           
 java.sql.Savepoint setSavepoint()
           
 java.sql.Savepoint setSavepoint(java.lang.String arg0)
           
 void setTransactionIsolation(int arg0)
           
 void setTypeMap(java.util.Map<java.lang.String,java.lang.Class<?>> arg0)
           
<T> T
unwrap(java.lang.Class<T> arg0)
           
 boolean validate()
           
 
Methods inherited from class com.metamatrix.common.pooling.impl.BaseResource
closeResource, getCheckedOutBy, getContainer, init, init, isClosed, isResourceAlive
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.sql.Connection
isClosed
 

Field Detail

SQL_TRACING_PROPERTY

public static final java.lang.String SQL_TRACING_PROPERTY
See Also:
Constant Field Values

DRIVER

public static final java.lang.String DRIVER
The environment property name for the class of the driver. This property is optional.

See Also:
Constant Field Values

PROTOCOL

public static final java.lang.String PROTOCOL
The environment property name for the protocol that is to be used. For JDBC, the connection URL information is created of the form "jdbc:subprotocol:subname", where the value of the PROTOCOL property is used for the "subprotocol:subname" portion. This property is required.

See Also:
Constant Field Values

DATABASE

public static final java.lang.String DATABASE
The environment property name for the database name. This may include the server name and port number, per the driver's requirements. This property is required.

See Also:
Constant Field Values

USERNAME

public static final java.lang.String USERNAME
The environment property name for the username that is to be used for connecting to the metadata store. This property is required.

See Also:
Constant Field Values

PASSWORD

public static final java.lang.String PASSWORD
The environment property name for the password that is to be used for connecting to the metadata store. This property is required.

See Also:
Constant Field Values

AUTOCOMMIT

public static final java.lang.String AUTOCOMMIT
The environment property name that indicates what the autocommit on the connection should be set to. Defaults to false

See Also:
Constant Field Values
Constructor Detail

JDBCConnectionResource

public JDBCConnectionResource(java.sql.Connection conn,
                              JDBCPlatform jdbcPlatform,
                              java.lang.Long id)
Method Detail

getPlatform

public JDBCPlatform getPlatform()

getResourceID

public java.lang.Long getResourceID()

validate

public boolean validate()

close

public void close()
           throws java.sql.SQLException
Specified by:
close in interface java.sql.Connection
Throws:
java.sql.SQLException

getConnection

protected java.sql.Connection getConnection()

performInit

protected void performInit()
                    throws ResourcePoolException
Description copied from class: BaseResource
Perform initialization allows for additional initialization by the implementor before the resource object is made avaialable for use.

Specified by:
performInit in class BaseResource
Throws:
ResourcePoolException - if an error occurs initializing resource.

checkIsResourceAlive

protected boolean checkIsResourceAlive()
Description copied from class: BaseResource
This method is invoked when BaseResource.isAlive is called to determine if the resource is operating normally. This logic is called by the pool when the resource is checked in to verify its state prior to placing it back in the pool.

A return of false indicates the resource should not be used. If the resource is unusable, it will be shutdown an another instance will take its place.

Specified by:
checkIsResourceAlive in class BaseResource
Returns:
boolean true if the resource is operating normally

clearWarnings

public void clearWarnings()
                   throws java.sql.SQLException
Specified by:
clearWarnings in interface java.sql.Connection
Throws:
java.sql.SQLException

commit

public void commit()
            throws java.sql.SQLException
Specified by:
commit in interface java.sql.Connection
Throws:
java.sql.SQLException

createArrayOf

public java.sql.Array createArrayOf(java.lang.String arg0,
                                    java.lang.Object[] arg1)
                             throws java.sql.SQLException
Specified by:
createArrayOf in interface java.sql.Connection
Throws:
java.sql.SQLException

createBlob

public java.sql.Blob createBlob()
                         throws java.sql.SQLException
Specified by:
createBlob in interface java.sql.Connection
Throws:
java.sql.SQLException

createClob

public java.sql.Clob createClob()
                         throws java.sql.SQLException
Specified by:
createClob in interface java.sql.Connection
Throws:
java.sql.SQLException

createNClob

public java.sql.NClob createNClob()
                           throws java.sql.SQLException
Specified by:
createNClob in interface java.sql.Connection
Throws:
java.sql.SQLException

createSQLXML

public java.sql.SQLXML createSQLXML()
                             throws java.sql.SQLException
Specified by:
createSQLXML in interface java.sql.Connection
Throws:
java.sql.SQLException

createStatement

public java.sql.Statement createStatement()
                                   throws java.sql.SQLException
Specified by:
createStatement in interface java.sql.Connection
Throws:
java.sql.SQLException

createStatement

public java.sql.Statement createStatement(int arg0,
                                          int arg1,
                                          int arg2)
                                   throws java.sql.SQLException
Specified by:
createStatement in interface java.sql.Connection
Throws:
java.sql.SQLException

createStatement

public java.sql.Statement createStatement(int arg0,
                                          int arg1)
                                   throws java.sql.SQLException
Specified by:
createStatement in interface java.sql.Connection
Throws:
java.sql.SQLException

createStruct

public java.sql.Struct createStruct(java.lang.String arg0,
                                    java.lang.Object[] arg1)
                             throws java.sql.SQLException
Specified by:
createStruct in interface java.sql.Connection
Throws:
java.sql.SQLException

getAutoCommit

public boolean getAutoCommit()
                      throws java.sql.SQLException
Specified by:
getAutoCommit in interface java.sql.Connection
Throws:
java.sql.SQLException

getCatalog

public java.lang.String getCatalog()
                            throws java.sql.SQLException
Specified by:
getCatalog in interface java.sql.Connection
Throws:
java.sql.SQLException

getClientInfo

public java.util.Properties getClientInfo()
                                   throws java.sql.SQLException
Specified by:
getClientInfo in interface java.sql.Connection
Throws:
java.sql.SQLException

getClientInfo

public java.lang.String getClientInfo(java.lang.String arg0)
                               throws java.sql.SQLException
Specified by:
getClientInfo in interface java.sql.Connection
Throws:
java.sql.SQLException

getHoldability

public int getHoldability()
                   throws java.sql.SQLException
Specified by:
getHoldability in interface java.sql.Connection
Throws:
java.sql.SQLException

getMetaData

public java.sql.DatabaseMetaData getMetaData()
                                      throws java.sql.SQLException
Specified by:
getMetaData in interface java.sql.Connection
Throws:
java.sql.SQLException

getTransactionIsolation

public int getTransactionIsolation()
                            throws java.sql.SQLException
Specified by:
getTransactionIsolation in interface java.sql.Connection
Throws:
java.sql.SQLException

getTypeMap

public java.util.Map<java.lang.String,java.lang.Class<?>> getTypeMap()
                                                              throws java.sql.SQLException
Specified by:
getTypeMap in interface java.sql.Connection
Throws:
java.sql.SQLException

getWarnings

public java.sql.SQLWarning getWarnings()
                                throws java.sql.SQLException
Specified by:
getWarnings in interface java.sql.Connection
Throws:
java.sql.SQLException

isReadOnly

public boolean isReadOnly()
                   throws java.sql.SQLException
Specified by:
isReadOnly in interface java.sql.Connection
Throws:
java.sql.SQLException

isValid

public boolean isValid(int arg0)
                throws java.sql.SQLException
Specified by:
isValid in interface java.sql.Connection
Throws:
java.sql.SQLException

isWrapperFor

public boolean isWrapperFor(java.lang.Class<?> arg0)
                     throws java.sql.SQLException
Specified by:
isWrapperFor in interface java.sql.Wrapper
Throws:
java.sql.SQLException

nativeSQL

public java.lang.String nativeSQL(java.lang.String arg0)
                           throws java.sql.SQLException
Specified by:
nativeSQL in interface java.sql.Connection
Throws:
java.sql.SQLException

prepareCall

public java.sql.CallableStatement prepareCall(java.lang.String arg0,
                                              int arg1,
                                              int arg2,
                                              int arg3)
                                       throws java.sql.SQLException
Specified by:
prepareCall in interface java.sql.Connection
Throws:
java.sql.SQLException

prepareCall

public java.sql.CallableStatement prepareCall(java.lang.String arg0,
                                              int arg1,
                                              int arg2)
                                       throws java.sql.SQLException
Specified by:
prepareCall in interface java.sql.Connection
Throws:
java.sql.SQLException

prepareCall

public java.sql.CallableStatement prepareCall(java.lang.String arg0)
                                       throws java.sql.SQLException
Specified by:
prepareCall in interface java.sql.Connection
Throws:
java.sql.SQLException

prepareStatement

public java.sql.PreparedStatement prepareStatement(java.lang.String arg0,
                                                   int arg1,
                                                   int arg2,
                                                   int arg3)
                                            throws java.sql.SQLException
Specified by:
prepareStatement in interface java.sql.Connection
Throws:
java.sql.SQLException

prepareStatement

public java.sql.PreparedStatement prepareStatement(java.lang.String arg0,
                                                   int arg1,
                                                   int arg2)
                                            throws java.sql.SQLException
Specified by:
prepareStatement in interface java.sql.Connection
Throws:
java.sql.SQLException

prepareStatement

public java.sql.PreparedStatement prepareStatement(java.lang.String arg0,
                                                   int arg1)
                                            throws java.sql.SQLException
Specified by:
prepareStatement in interface java.sql.Connection
Throws:
java.sql.SQLException

prepareStatement

public java.sql.PreparedStatement prepareStatement(java.lang.String arg0,
                                                   int[] arg1)
                                            throws java.sql.SQLException
Specified by:
prepareStatement in interface java.sql.Connection
Throws:
java.sql.SQLException

prepareStatement

public java.sql.PreparedStatement prepareStatement(java.lang.String arg0,
                                                   java.lang.String[] arg1)
                                            throws java.sql.SQLException
Specified by:
prepareStatement in interface java.sql.Connection
Throws:
java.sql.SQLException

prepareStatement

public java.sql.PreparedStatement prepareStatement(java.lang.String arg0)
                                            throws java.sql.SQLException
Specified by:
prepareStatement in interface java.sql.Connection
Throws:
java.sql.SQLException

releaseSavepoint

public void releaseSavepoint(java.sql.Savepoint arg0)
                      throws java.sql.SQLException
Specified by:
releaseSavepoint in interface java.sql.Connection
Throws:
java.sql.SQLException

rollback

public void rollback()
              throws java.sql.SQLException
Specified by:
rollback in interface java.sql.Connection
Throws:
java.sql.SQLException

rollback

public void rollback(java.sql.Savepoint arg0)
              throws java.sql.SQLException
Specified by:
rollback in interface java.sql.Connection
Throws:
java.sql.SQLException

setAutoCommit

public void setAutoCommit(boolean arg0)
                   throws java.sql.SQLException
Specified by:
setAutoCommit in interface java.sql.Connection
Throws:
java.sql.SQLException

setCatalog

public void setCatalog(java.lang.String arg0)
                throws java.sql.SQLException
Specified by:
setCatalog in interface java.sql.Connection
Throws:
java.sql.SQLException

setClientInfo

public void setClientInfo(java.util.Properties arg0)
                   throws java.sql.SQLClientInfoException
Specified by:
setClientInfo in interface java.sql.Connection
Throws:
java.sql.SQLClientInfoException

setClientInfo

public void setClientInfo(java.lang.String arg0,
                          java.lang.String arg1)
                   throws java.sql.SQLClientInfoException
Specified by:
setClientInfo in interface java.sql.Connection
Throws:
java.sql.SQLClientInfoException

setHoldability

public void setHoldability(int arg0)
                    throws java.sql.SQLException
Specified by:
setHoldability in interface java.sql.Connection
Throws:
java.sql.SQLException

setReadOnly

public void setReadOnly(boolean arg0)
                 throws java.sql.SQLException
Specified by:
setReadOnly in interface java.sql.Connection
Throws:
java.sql.SQLException

setSavepoint

public java.sql.Savepoint setSavepoint()
                                throws java.sql.SQLException
Specified by:
setSavepoint in interface java.sql.Connection
Throws:
java.sql.SQLException

setSavepoint

public java.sql.Savepoint setSavepoint(java.lang.String arg0)
                                throws java.sql.SQLException
Specified by:
setSavepoint in interface java.sql.Connection
Throws:
java.sql.SQLException

setTransactionIsolation

public void setTransactionIsolation(int arg0)
                             throws java.sql.SQLException
Specified by:
setTransactionIsolation in interface java.sql.Connection
Throws:
java.sql.SQLException

setTypeMap

public void setTypeMap(java.util.Map<java.lang.String,java.lang.Class<?>> arg0)
                throws java.sql.SQLException
Specified by:
setTypeMap in interface java.sql.Connection
Throws:
java.sql.SQLException

unwrap

public <T> T unwrap(java.lang.Class<T> arg0)
         throws java.sql.SQLException
Specified by:
unwrap in interface java.sql.Wrapper
Throws:
java.sql.SQLException


Copyright © 2009. All Rights Reserved.