Package org.apache.derby.impl.jdbc
Class ConnectionChild
- java.lang.Object
-
- org.apache.derby.impl.jdbc.ConnectionChild
-
- Direct Known Subclasses:
EmbedBlob
,EmbedClob
,EmbedDatabaseMetaData
,EmbedResultSet
,EmbedSavepoint
,EmbedStatement
abstract class ConnectionChild extends java.lang.Object
Any class in the embedded JDBC driver (ie this package) that needs to refer back to the EmbedConnection object extends this class.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Calendar
cal
Calendar for data operations.(package private) InternalDriver
factory
Factory for JDBC objects to be created.private LanguageConnectionContext
lcc
Cached LanguageConnectionContext(package private) EmbedConnection
localConn
-
Constructor Summary
Constructors Constructor Description ConnectionChild(EmbedConnection conn)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) void
commitIfAutoCommit()
Perform a commit if autocommit is enabled.(package private) void
commitIfNeeded()
Perform a commit if one is needed.(package private) java.util.Calendar
getCal()
Get and save a unique calendar object for this JDBC object.(package private) java.lang.Object
getConnectionSynchronization()
Return an object to be used for connection synchronization.(package private) EmbedConnection
getEmbedConnection()
Return a reference to the EmbedConnection(package private) LanguageConnectionContext
getLanguageConnectionContext(EmbedConnection conn)
Get and cache the LanguageConnectionContext for this connection.(package private) static LanguageConnectionContext
getLCC(EmbedConnection conn)
Gets the LanguageConnectionContext for this connection.(package private) java.sql.SQLException
handleException(java.lang.Throwable t)
Handle any exception.(package private) void
needCommit()
If Autocommit is on, note that a commit is needed.(package private) static java.sql.SQLException
newSQLException(java.lang.String messageId, java.lang.Object... args)
(package private) void
restoreContextStack()
Setup the context stack (a.k.a. context manager) for this connection.protected static void
restoreIntrFlagIfSeen(boolean pushStack, EmbedConnection ec)
(package private) void
setupContextStack()
Setup the context stack (a.k.a. context manager) for this connection.
-
-
-
Field Detail
-
localConn
EmbedConnection localConn
-
lcc
private LanguageConnectionContext lcc
Cached LanguageConnectionContext
-
factory
final InternalDriver factory
Factory for JDBC objects to be created.
-
cal
private java.util.Calendar cal
Calendar for data operations.
-
-
Constructor Detail
-
ConnectionChild
ConnectionChild(EmbedConnection conn)
-
-
Method Detail
-
getEmbedConnection
final EmbedConnection getEmbedConnection()
Return a reference to the EmbedConnection
-
getConnectionSynchronization
final java.lang.Object getConnectionSynchronization()
Return an object to be used for connection synchronization.
-
handleException
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)
-
needCommit
final void needCommit()
If Autocommit is on, note that a commit is needed.- See Also:
EmbedConnection.needCommit
-
commitIfNeeded
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
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
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
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()
-
getCal
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
static java.sql.SQLException newSQLException(java.lang.String messageId, java.lang.Object... args)
-
restoreIntrFlagIfSeen
protected static void restoreIntrFlagIfSeen(boolean pushStack, EmbedConnection ec)
-
getLanguageConnectionContext
LanguageConnectionContext getLanguageConnectionContext(EmbedConnection conn)
Get and cache the LanguageConnectionContext for this connection.
-
getLCC
static LanguageConnectionContext getLCC(EmbedConnection conn)
Gets the LanguageConnectionContext for this connection.
-
-