Package virtuoso.jdbc4

## Class VirtuosoPooledConnection

- java.lang.Object
- - virtuoso.jdbc4.VirtuosoPooledConnection

All Implemented Interfaces:
  `java.lang.Cloneable`, `javax.sql.PooledConnection`

    public class VirtuosoPooledConnection
    extends java.lang.Object
    implements javax.sql.PooledConnection, java.lang.Cloneable

A PooledConnection object is a connection object that provides hooks for connection pool management. A PooledConnection object represents a physical connection to a data source.

### Field Summary

Fields
`protected java.lang.String` `connURL`
`protected int` `hashConnURL`
`protected long` `tmClosed`

### Constructor Summary

Constructors
`protected` `VirtuosoPooledConnection​(VirtuosoConnection _conn, java.lang.String _connURL)`
`protected` `VirtuosoPooledConnection​(VirtuosoConnection _conn, java.lang.String _connURL, VirtuosoConnectionPoolDataSource listener)`

### Method Summary

All Methods Instance Methods Concrete Methods Deprecated Methods
`void` `addConnectionEventListener​(javax.sql.ConnectionEventListener parm)` Registers the given event listener so that it will be notified when an event occurs on this `PooledConnection` object.
`void` `addStatementEventListener​(javax.sql.StatementEventListener listener)` Registers a `StatementEventListener` with this `PooledConnection` object.
`protected java.lang.Object` `clone​()`
`void` `close​()` Closes the physical connection that this `PooledConnection` object represents.
`void` `closeAll​()` Deprecated.
`void` `finalize​()`
`java.sql.Connection` `getConnection​()` Create an object handle for this physical connection.
`VirtuosoConnection` `getVirtuosoConnection​()`
`protected void` `init​(VirtuosoConnectionPoolDataSource listener)`
`protected boolean` `isClosed​()`
`boolean` `isConnectionLost​(int timeout_sec)`
`void` `removeConnectionEventListener​(javax.sql.ConnectionEventListener parm)` Removes the given event listener from the list of components that will be notified when an event occurs on this `PooledConnection` object.
`void` `removeStatementEventListener​(javax.sql.StatementEventListener listener)` Removes the specified `StatementEventListener` from the list of components that will be notified when the driver detects that a `PreparedStatement` has been closed or is invalid.
`protected VirtuosoPooledConnection` `reuse​()`
`protected void` `sendCloseEvent​()`
`protected void` `sendErrorEvent​(java.sql.SQLException ex)`

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### connURL

    protected java.lang.String connURL

#### hashConnURL

    protected int hashConnURL

#### tmClosed

    protected long tmClosed

### Constructor Detail

#### VirtuosoPooledConnection

    protected VirtuosoPooledConnection​(VirtuosoConnection _conn,
                                       java.lang.String _connURL)

#### VirtuosoPooledConnection

    protected VirtuosoPooledConnection​(VirtuosoConnection _conn,
                                       java.lang.String _connURL,
                                       VirtuosoConnectionPoolDataSource listener)

### Method Detail

#### init

    protected void init​(VirtuosoConnectionPoolDataSource listener)

#### finalize

    public void finalize​()
                  throws java.lang.Throwable

Overrides:
  `finalize` in class `java.lang.Object`
Throws:
  `java.lang.Throwable`

#### clone

    protected java.lang.Object clone​()

Overrides:
  `clone` in class `java.lang.Object`

#### reuse

    protected VirtuosoPooledConnection reuse​()

#### addConnectionEventListener

    public void addConnectionEventListener​(javax.sql.ConnectionEventListener parm)

Registers the given event listener so that it will be notified when an event occurs on this `PooledConnection` object.

Specified by:
  `addConnectionEventListener` in interface `javax.sql.PooledConnection`
Parameters:
  `parm` - listener a component, usually the connection pool manager, that has implemented the `ConnectionEventListener` interface and wants to be notified when the connection is closed or has an error
See Also:
  `removeConnectionEventListener(javax.sql.ConnectionEventListener)`

#### removeConnectionEventListener

    public void removeConnectionEventListener​(javax.sql.ConnectionEventListener parm)

Removes the given event listener from the list of components that will be notified when an event occurs on this `PooledConnection` object.

Specified by:
  `removeConnectionEventListener` in interface `javax.sql.PooledConnection`
Parameters:
  `parm` - listener a component, usually the connection pool manager, that has implemented the `ConnectionEventListener` interface and been registered with this `PooledConnection` object as a listener
See Also:
  `addConnectionEventListener(javax.sql.ConnectionEventListener)`

#### close

    public void close​()
               throws java.sql.SQLException

Closes the physical connection that this `PooledConnection` object represents. An application never calls this method directly; it is called by the connection pool module, or manager.

See the `interface description` for more information.

Specified by:
  `close` in interface `javax.sql.PooledConnection`
Throws:
  `java.sql.SQLException` - if a database access error occurs

#### closeAll

    @Deprecated
    public void closeAll​()
                  throws java.sql.SQLException

Deprecated.
Close all the Statement objects that have been opened by this PooledConnection object.

Throws:
  `java.sql.SQLException` - if a database-access error occurs

#### getConnection

    public java.sql.Connection getConnection​()
                                      throws java.sql.SQLException

Create an object handle for this physical connection. The object returned is a temporary handle used by application code to refer to a physical connection that is being pooled.

Specified by:
  `getConnection` in interface `javax.sql.PooledConnection`
Returns:
  a Connection object
Throws:
  `java.sql.SQLException` - if a database-access error occurs

#### getVirtuosoConnection

    public VirtuosoConnection getVirtuosoConnection​()
                                             throws java.sql.SQLException

Throws:
  `java.sql.SQLException`

#### isConnectionLost

    public boolean isConnectionLost​(int timeout_sec)

#### addStatementEventListener

    public void addStatementEventListener​(javax.sql.StatementEventListener listener)

Registers a `StatementEventListener` with this `PooledConnection` object. Components that wish to be notified when `PreparedStatement`s created by the connection are closed or are detected to be invalid may use this method to register a `StatementEventListener` with this `PooledConnection` object.

Specified by:
  `addStatementEventListener` in interface `javax.sql.PooledConnection`
Parameters:
  `listener` - an component which implements the `StatementEventListener` interface that is to be registered with this `PooledConnection` object

Since:
  1.6

#### removeStatementEventListener

    public void removeStatementEventListener​(javax.sql.StatementEventListener listener)

Removes the specified `StatementEventListener` from the list of components that will be notified when the driver detects that a `PreparedStatement` has been closed or is invalid.

Specified by:
  `removeStatementEventListener` in interface `javax.sql.PooledConnection`
Parameters:
  `listener` - the component which implements the `StatementEventListener` interface that was previously registered with this `PooledConnection` object

Since:
  1.6

#### isClosed

    protected boolean isClosed​()

#### sendCloseEvent

    protected void sendCloseEvent​()

#### sendErrorEvent

    protected void sendErrorEvent​(java.sql.SQLException ex)