org.apache.derby.client
Class ClientPooledConnection40

java.lang.Object
  extended by org.apache.derby.client.ClientPooledConnection
      extended by org.apache.derby.client.ClientPooledConnection40
All Implemented Interfaces:
javax.sql.PooledConnection

public class ClientPooledConnection40
extends ClientPooledConnection

The class extends from the ClientPooledConnection class and contains implementations for the JDBC 4.0 specific methods in the javax.sql.PooledConnection interface.


Field Summary
private  java.util.concurrent.CopyOnWriteArrayList<javax.sql.StatementEventListener> statementEventListeners
          List of statement event listeners.
 
Fields inherited from class org.apache.derby.client.ClientPooledConnection
logicalConnection_, logWriter_, netPhysicalConnection_, netXAPhysicalConnection_, physicalConnection_, rmId_
 
Constructor Summary
ClientPooledConnection40(ClientBaseDataSource ds, LogWriter logWriter, java.lang.String user, java.lang.String password)
           
ClientPooledConnection40(ClientBaseDataSource ds, LogWriter logWriter, java.lang.String user, java.lang.String password, int rmId)
           
 
Method Summary
 void addStatementEventListener(javax.sql.StatementEventListener listener)
          Registers a StatementEventListener with this PooledConnection object.
 void onStatementClose(java.sql.PreparedStatement statement)
          Raise the statementClosed event for all the listeners when the corresponding events occurs.
 void onStatementErrorOccurred(java.sql.PreparedStatement statement, java.sql.SQLException sqle)
          Raise the statementErrorOccurred event for all the listeners when the corresponding events occurs.
 void removeStatementEventListener(javax.sql.StatementEventListener listener)
          Removes the specified previously registered listener object from the list of components that would be informed of events with a PreparedStatement object.
 
Methods inherited from class org.apache.derby.client.ClientPooledConnection
addConnectionEventListener, close, finalize, getConnection, getNetXAConnection, informListeners, isStatementPoolingEnabled, nullLogicalConnection, recycleConnection, removeConnectionEventListener
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

statementEventListeners

private final java.util.concurrent.CopyOnWriteArrayList<javax.sql.StatementEventListener> statementEventListeners
List of statement event listeners. The list is copied on each write, ensuring that it can be safely iterated over even if other threads or the listeners fired in the same thread add or remove listeners.

Constructor Detail

ClientPooledConnection40

public ClientPooledConnection40(ClientBaseDataSource ds,
                                LogWriter logWriter,
                                java.lang.String user,
                                java.lang.String password)
                         throws java.sql.SQLException
Throws:
java.sql.SQLException

ClientPooledConnection40

public ClientPooledConnection40(ClientBaseDataSource ds,
                                LogWriter logWriter,
                                java.lang.String user,
                                java.lang.String password,
                                int rmId)
                         throws java.sql.SQLException
Throws:
java.sql.SQLException
Method Detail

addStatementEventListener

public void addStatementEventListener(javax.sql.StatementEventListener listener)
Registers a StatementEventListener with this PooledConnection object. Components that wish to be informed of events associated with the PreparedStatement object created by this PooledConnection like the close or error occurred event can register a StatementEventListener with this PooledConnection object.

Parameters:
listener - A component that implements the StatementEventListener interface and wants to be notified of Statement closed or or Statement error occurred events

removeStatementEventListener

public void removeStatementEventListener(javax.sql.StatementEventListener listener)
Removes the specified previously registered listener object from the list of components that would be informed of events with a PreparedStatement object.

Parameters:
listener - The previously registered event listener that needs to be removed from the list of components

onStatementClose

public void onStatementClose(java.sql.PreparedStatement statement)
Raise the statementClosed event for all the listeners when the corresponding events occurs.

Overrides:
onStatementClose in class ClientPooledConnection
Parameters:
statement - The PreparedStatement that was closed

onStatementErrorOccurred

public void onStatementErrorOccurred(java.sql.PreparedStatement statement,
                                     java.sql.SQLException sqle)
Raise the statementErrorOccurred event for all the listeners when the corresponding events occurs.

Overrides:
onStatementErrorOccurred in class ClientPooledConnection
Parameters:
statement - The PreparedStatement on which error occurred
sqle - The SQLException associated with the error that caused the invalidation of the PreparedStatements

Built on Thu 2010-12-23 20:49:13+0000, from revision ???

Apache Derby V10.6 Internals - Copyright © 2004,2007 The Apache Software Foundation. All Rights Reserved.