|
Oracle® TimesTen In-Memory Database JDBC Extensions Java API Reference 11g Release 2 (11.2.2) E21647-02 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
com.timesten.jdbc.JdbcOdbcObject
com.timesten.jdbc.ObservableConnection
public class ObservableConnection
An ObservableConnection
implements the the PooledConnection
interface, as defined in JDBC 2.0 An ObservableConnection
holds a physical connection to a data source, and is itself a factory for ProxyConnection
objects. There can be many ConnectionEventListener
(observers) registered with an ObservableConnection
. These observers are notified if the user calls close
on the connection, or if there is an error on the connection that renders it useless, such as a data store invalidation. This interface is usually used by an application server connection pool implementation, and not directly by an user application.
NOTE: TimesTen JDBC driver itself does NOT implement database connection pools. This class merely implements PooledConnection, a standard J2EE interface, which faciliates creation and management of database connection pools per the J2EE standard.
Field Summary |
---|
Fields inherited from class com.timesten.jdbc.JdbcOdbcObject |
---|
TT_JAVA_TIME_DIFFERENCE |
Constructor Summary | |
---|---|
ObservableConnection(com.timesten.jdbc.JdbcOdbcConnection conn) Constructs an ObservableConnection object. |
|
ObservableConnection(com.timesten.jdbc.JdbcOdbcConnection conn, int maxStatements) Constructs an ObservableConnection object. |
Method Summary | |
---|---|
void |
addConnectionEventListener(javax.sql.ConnectionEventListener observer) This method is a required part of the PooledConnection interface. |
void |
addStatementEventListener(javax.sql.StatementEventListener listener) |
void |
close() This method is a required part of the PooledConnection interface. |
java.sql.Connection |
getConnection() This method is a required part of the PooledConnection interface. |
void |
removeConnectionEventListener(javax.sql.ConnectionEventListener observer) This method is a required part of the PooledConnection interface. |
void |
removeStatementEventListener(javax.sql.StatementEventListener listener) |
Methods inherited from class com.timesten.jdbc.JdbcOdbcObject |
---|
BytesToChars, CharsToBytes, CharsToBytes, hexPad, hexPairToInt, hexStringToByteArray, isConnectionBroken, toHex |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ObservableConnection(com.timesten.jdbc.JdbcOdbcConnection conn)
ObservableConnection
object. This just stores the physical connection object.
conn
- real database connection for that is observed.public ObservableConnection(com.timesten.jdbc.JdbcOdbcConnection conn, int maxStatements)
ObservableConnection
object. This just stores the physical connection object.
conn
- real database connection for that is observed.maxStatements
- number of pooled prepared statementsMethod Detail |
---|
public java.sql.Connection getConnection() throws java.sql.SQLException
PooledConnection
interface. Calls getConnectionInternal
to do the real work. From an application's point of view, there is no difference between the object returned by this method and one that is returned from TimesTenDataSource.getConnection
or DriverManager.getConnection
. However when the application calls ProxyConnection.close
the underlying physical connection is not closed.getConnection
in interface javax.sql.PooledConnection
Connection
object that is a proxy object to the real connection object that this ObservableConnection
object represents.java.sql.SQLException
- if a database access error occurs.public void close() throws java.sql.SQLException
PooledConnection
interface. Closes the real underlying connection that this PooledConnection
object represents.close
in interface javax.sql.PooledConnection
java.sql.SQLException
- if a database access error occurspublic void addConnectionEventListener(javax.sql.ConnectionEventListener observer)
PooledConnection
interface. Registers the given event listener so that it will be notified when an event occurs on this PooledConnection
object.addConnectionEventListener
in interface javax.sql.PooledConnection
observer
- a component that has implemented the ConnectionEventListener
interface and wants to be notified when the connection is closed or has an error; generally, a connection pool managerremoveConnectionEventListener(javax.sql.ConnectionEventListener)
public void removeConnectionEventListener(javax.sql.ConnectionEventListener observer)
PooledConnection
interface. Removes the given event listener from the list of components that will be notified when an event occurs on this PooledConnection
object.removeConnectionEventListener
in interface javax.sql.PooledConnection
observer
- a component that has implemented the ConnectionEventListener
interface and been been registered as a listener; generally, a connection pool manageraddConnectionEventListener(javax.sql.ConnectionEventListener)
public void addStatementEventListener(javax.sql.StatementEventListener listener)
addStatementEventListener
in interface javax.sql.PooledConnection
public void removeStatementEventListener(javax.sql.StatementEventListener listener)
removeStatementEventListener
in interface javax.sql.PooledConnection
|
Oracle® TimesTen In-Memory Database JDBC Extensions Java API Reference 11g Release 2 (11.2.2) E21647-02 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |