org.apache.derby.impl.jdbc
Class ConnectionChild

java.lang.Object
  extended byorg.apache.derby.impl.jdbc.ConnectionChild
Direct Known Subclasses:
EmbedBlob, EmbedClob, EmbedDatabaseMetaData, EmbedResultSet, EmbedSavepoint30, EmbedStatement

abstract class ConnectionChild
extends java.lang.Object

Any class in the local JDBC driver (ie this package) that needs to refer back to the EmbedConnection object extends this class.


Field Summary
private  java.util.Calendar cal
          Calendar for data operations.
protected static boolean CLOSE
           
protected  InternalDriver factory
          Factory for JDBC objects to be created.
protected  EmbedConnection localConn
           
protected static boolean NOCLOSE
           
 
Constructor Summary
protected ConnectionChild(EmbedConnection conn)
           
 
Method Summary
protected  void commitIfAutoCommit()
          Perform a commit if autocommit is enabled.
protected  void commitIfNeeded()
          Perform a commit if one is needed.
protected  java.util.Calendar getCal()
          Get and save a unique calendar object for this JDBC object.
protected  java.lang.Object getConnectionSynchronization()
          Return an object to be used for connection synchronization.
 ContextManager getContextManager()
           
 Database getDatabase()
           
protected  EmbedConnection getEmbedConnection()
          Return a reference to the EmbedConnection
protected  java.sql.SQLException handleException(java.lang.Throwable t)
          Handle any exception.
protected  java.sql.SQLException handleException(java.lang.Throwable t, boolean close)
          Handle any exception.
protected  void needCommit()
          If Autocommit is on, note that a commit is needed.
protected  java.sql.SQLException newSQLException(java.lang.String messageId)
           
protected  java.sql.SQLException newSQLException(java.lang.String messageId, java.lang.Object arg1)
           
protected  java.sql.SQLException newSQLException(java.lang.String messageId, java.lang.Object arg1, java.lang.Object arg2)
           
protected  void restoreContextStack()
          Setup the context stack (a.k.a. context manager) for this connection.
protected  void setupContextStack()
          Setup the context stack (a.k.a. context manager) for this connection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLOSE

protected static final boolean CLOSE
See Also:
Constant Field Values

NOCLOSE

protected static final boolean NOCLOSE
See Also:
Constant Field Values

localConn

protected EmbedConnection localConn

factory

protected final InternalDriver factory
Factory for JDBC objects to be created.


cal

private java.util.Calendar cal
Calendar for data operations.

Constructor Detail

ConnectionChild

protected ConnectionChild(EmbedConnection conn)
Method Detail

getEmbedConnection

protected final EmbedConnection getEmbedConnection()
Return a reference to the EmbedConnection


getConnectionSynchronization

protected final java.lang.Object getConnectionSynchronization()
Return an object to be used for connection synchronization.


handleException

protected final java.sql.SQLException handleException(java.lang.Throwable t)
                                               throws java.sql.SQLException
Handle any exception.

Throws:
java.sql.SQLException - thrown if can't handle
See Also:
EmbedConnection.handleException(java.lang.Throwable)

handleException

protected final java.sql.SQLException handleException(java.lang.Throwable t,
                                                      boolean close)
                                               throws java.sql.SQLException
Handle any exception.

Throws:
java.sql.SQLException - thrown if can't handle
See Also:
EmbedConnection.handleException(java.lang.Throwable)

needCommit

protected final void needCommit()
If Autocommit is on, note that a commit is needed.

See Also:
EmbedConnection.needCommit

commitIfNeeded

protected final void commitIfNeeded()
                             throws java.sql.SQLException
Perform a commit if one is needed.

Throws:
java.sql.SQLException - thrown on failure
See Also:
EmbedConnection.commitIfNeeded()

commitIfAutoCommit

protected final void commitIfAutoCommit()
                                 throws java.sql.SQLException
Perform a commit if autocommit is enabled.

Throws:
java.sql.SQLException - thrown on failure
See Also:
EmbedConnection.commitIfNeeded()

setupContextStack

protected final void setupContextStack()
                                throws java.sql.SQLException
Setup the context stack (a.k.a. context manager) for this connection.

Throws:
java.sql.SQLException - thrown on failure
See Also:
EmbedConnection.setupContextStack()

restoreContextStack

protected final void restoreContextStack()
                                  throws java.sql.SQLException
Setup the context stack (a.k.a. context manager) for this connection.

Throws:
java.sql.SQLException - thrown on failure
See Also:
EmbedConnection.restoreContextStack()

getContextManager

public ContextManager getContextManager()

getDatabase

public Database getDatabase()

getCal

protected java.util.Calendar getCal()
Get and save a unique calendar object for this JDBC object. No need to synchronize because multiple threads should not be using a single JDBC object. Even if they do there is only a small window where each would get its own Calendar for a single call.


newSQLException

protected java.sql.SQLException newSQLException(java.lang.String messageId)

newSQLException

protected java.sql.SQLException newSQLException(java.lang.String messageId,
                                                java.lang.Object arg1)

newSQLException

protected java.sql.SQLException newSQLException(java.lang.String messageId,
                                                java.lang.Object arg1,
                                                java.lang.Object arg2)

Built on Tue 2006-10-10 19:23:47+0200, from revision exported

Apache Derby V10.1 Engine Documentation - Copyright © 1997,2005 The Apache Software Foundation or its licensors, as applicable.