com.metamatrix.common.connection.jdbc
Class JDBCMgdResourceConnection

java.lang.Object
  extended by com.metamatrix.common.connection.ManagedConnection
      extended by com.metamatrix.common.connection.jdbc.JDBCMgdResourceConnection

public class JDBCMgdResourceConnection
extends ManagedConnection


Nested Class Summary
 
Nested classes/interfaces inherited from class com.metamatrix.common.connection.ManagedConnection
ManagedConnection.ConnectionStatistics
 
Field Summary
 
Fields inherited from class com.metamatrix.common.connection.ManagedConnection
DATABASE, DRIVER, PASSWORD, PROTOCOL, USERNAME
 
Constructor Summary
JDBCMgdResourceConnection(java.util.Properties env, java.lang.String userName)
          Create a new instance of a JDBC connection.
 
Method Summary
protected  void closeConnection()
          This method is invoked by the pool to notify the specialized class that the connection is to be terminated.
 java.sql.Connection getConnection()
          Create the JDBC connection that is being managed.
protected  void openConnection()
          This method is invoked by the pool to notify the specialized class that the connection is to be established.
protected  void performCommit()
          Make all changes made since the previous commit/rollback permanent, and release any data source locks currently held by the Connection.
protected  void performRollback()
          Make all changes made since the previous commit/rollback permanent, and release any data source locks currently held by the Connection.
protected  void prepareForRead()
          Prepare this connection for read-only transactions.
protected  void prepareForWrite()
          Prepare this connection for write transactions.
 
Methods inherited from class com.metamatrix.common.connection.ManagedConnection
close, commit, finalize, getEnvironment, getStats, getUserName, open, rollback, setForRead, setForWrite, setUserName
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JDBCMgdResourceConnection

public JDBCMgdResourceConnection(java.util.Properties env,
                                 java.lang.String userName)
Create a new instance of a JDBC connection.

Parameters:
env - the environment properties for the new connection.
Method Detail

getConnection

public java.sql.Connection getConnection()
Create the JDBC connection that is being managed.

Returns:
the JDBC connection object.

openConnection

protected void openConnection()
                       throws ManagedConnectionException
This method is invoked by the pool to notify the specialized class that the connection is to be established.

Specified by:
openConnection in class ManagedConnection
Throws:
ManagedConnectionException - if there is an error establishing the connection.

closeConnection

protected void closeConnection()
                        throws ManagedConnectionException
This method is invoked by the pool to notify the specialized class that the connection is to be terminated.

Specified by:
closeConnection in class ManagedConnection
Throws:
ManagedConnectionException - if there is an error terminating the connection.

prepareForRead

protected void prepareForRead()
                       throws ManagedConnectionException
Prepare this connection for read-only transactions.

Specified by:
prepareForRead in class ManagedConnection
Throws:
ManagedConnectionException - if an error occurred within or during communication with this connection.

prepareForWrite

protected void prepareForWrite()
                        throws ManagedConnectionException
Prepare this connection for write transactions.

Specified by:
prepareForWrite in class ManagedConnection
Throws:
ManagedConnectionException - if an error occurred within or during communication with this connection.

performCommit

protected void performCommit()
                      throws ManagedConnectionException
Make all changes made since the previous commit/rollback permanent, and release any data source locks currently held by the Connection.

Specified by:
performCommit in class ManagedConnection
Throws:
ManagedConnectionException - if an error occurred within or during communication with this connection.

performRollback

protected void performRollback()
                        throws ManagedConnectionException
Make all changes made since the previous commit/rollback permanent, and release any data source locks currently held by the Connection.

Specified by:
performRollback in class ManagedConnection
Throws:
ManagedConnectionException - if an error occurred within or during communication with this connection.


Copyright © 2009. All Rights Reserved.