org.firebirdsql.pool
Class AbstractDriverConnectionPoolDataSource

java.lang.Object
  extended by org.firebirdsql.ds.RootCommonDataSource
      extended by org.firebirdsql.pool.AbstractConnectionPool
          extended by org.firebirdsql.pool.BasicAbstractConnectionPool
              extended by org.firebirdsql.pool.AbstractDriverConnectionPoolDataSource
All Implemented Interfaces:
java.io.Serializable, java.util.EventListener, javax.naming.Referenceable, javax.sql.CommonDataSource, javax.sql.ConnectionEventListener, javax.sql.ConnectionPoolDataSource, ConnectionPoolConfiguration, PooledConnectionEventListener, PooledObjectListener
Direct Known Subclasses:
DriverConnectionPoolDataSource

Deprecated.

@Deprecated
public abstract class AbstractDriverConnectionPoolDataSource
extends BasicAbstractConnectionPool
implements javax.sql.ConnectionPoolDataSource, PooledConnectionEventListener

Generic implementation of ConnectionPoolDataSource that uses DriverManager to open physical connections to the database.

Author:
Roman Rokytskyy
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.firebirdsql.pool.AbstractConnectionPool
AbstractConnectionPool.UserPasswordPair
 
Field Summary
protected static java.lang.String DRIVER_CLASS_NAME
          Deprecated.  
static AbstractConnectionPool.UserPasswordPair EMPTY_USER_PASSWORD
          Deprecated.  
protected static java.lang.String JDBC_URL
          Deprecated.  
protected static java.lang.String PROPERTIES
          Deprecated.  
 
Constructor Summary
AbstractDriverConnectionPoolDataSource()
          Deprecated.  
 
Method Summary
 void connectionClosed(javax.sql.ConnectionEvent connectionEvent)
          Deprecated. Notify about connection being closed.
 void connectionErrorOccurred(javax.sql.ConnectionEvent event)
          Deprecated. Notify about serious error when using the connection.
protected  BasicAbstractConnectionPool createObjectInstance()
          Deprecated. Create instance of this data source.
protected  PooledConnectionManager getConnectionManager()
          Deprecated. Get connection manager that will allocate physical connections to the database.
 javax.naming.Reference getDefaultReference()
          Deprecated. Get default JNDI reference for this instance.
 java.lang.String getDriverClassName()
          Deprecated.  
 int getFreeSize()
          Deprecated. Get number of free connections in this pool.
 java.lang.String getIsolation()
          Deprecated.  
 java.lang.String getJdbcUrl()
          Deprecated.  
protected  org.firebirdsql.logging.Logger getLogger()
          Deprecated. Get logger for this instance.
 int getLoginTimeout()
          Deprecated. Get login timeout.
 java.io.PrintWriter getLogWriter()
          Deprecated.  
 javax.sql.PooledConnection getPooledConnection()
          Deprecated. Get pooled connection.
protected  PooledObject getPooledConnection(org.firebirdsql.pool.PooledConnectionQueue queue)
          Deprecated. Get pooled connection from the pooled queue.
 javax.sql.PooledConnection getPooledConnection(java.lang.String user, java.lang.String password)
          Deprecated. Get pooled connection for the specified user name and password.
protected  java.lang.String getPoolName()
          Deprecated. Get name of this connection pool.
 java.util.Properties getProperties()
          Deprecated.  
 java.lang.String getProperty(java.lang.String name)
          Deprecated.  
 int getTotalSize()
          Deprecated. Get total size of physical connections opened to the database.
 int getTransactionIsolationLevel()
          Deprecated.  
 int getWorkingSize()
          Deprecated. Get number of connections that are in use.
 void physicalConnectionClosed(javax.sql.ConnectionEvent connectionEvent)
          Deprecated. Notify about physical connection being closed.
 void physicalConnectionDeallocated(javax.sql.ConnectionEvent connectionEvent)
          Deprecated. Notify about the deallocation of the physical connection.
protected  java.lang.Object processObjectInstance(AbstractDriverConnectionPoolDataSource ds, java.lang.Object obj)
          Deprecated.  
 void setDriverClassName(java.lang.String driverClassName)
          Deprecated.  
 void setIsolation(java.lang.String isolation)
          Deprecated.  
 void setJdbcUrl(java.lang.String jdbcUrl)
          Deprecated.  
 void setLoginTimeout(int seconds)
          Deprecated. Set login timeout for new connection.
 void setLogWriter(java.io.PrintWriter out)
          Deprecated.  
 void setProperties(java.util.Properties properties)
          Deprecated. Set JDBC properties that will be passed when opening a connection.
 void setProperty(java.lang.String name, java.lang.String value)
          Deprecated.  
 void setTransactionIsolationLevel(int transactionIsolation)
          Deprecated.  
 
Methods inherited from class org.firebirdsql.pool.BasicAbstractConnectionPool
deserialize, getBlockingTimeout, getConfiguration, getIdleTimeout, getMaxConnections, getMaxIdleTime, getMaxPoolSize, getMaxStatements, getMinConnections, getMinPoolSize, getObjectInstance, getPingInterval, getPingStatement, getRefAddr, getReference, getRetryInterval, isKeepStatements, isPingable, isPooling, isStatementPooling, serialize, setBlockingTimeout, setIdleTimeout, setKeepStatements, setMaxConnections, setMaxIdleTime, setMaxPoolSize, setMaxStatements, setMinConnections, setMinPoolSize, setPingInterval, setPingStatement, setPooling, setReference, setRetryInterval, setStatementPooling
 
Methods inherited from class org.firebirdsql.pool.AbstractConnectionPool
finalize, getQueue, physicalConnectionDeallocated, pooledObjectReleased, restart, shutdown
 
Methods inherited from class org.firebirdsql.ds.RootCommonDataSource
getParentLogger
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMPTY_USER_PASSWORD

public static final AbstractConnectionPool.UserPasswordPair EMPTY_USER_PASSWORD
Deprecated. 

PROPERTIES

protected static final java.lang.String PROPERTIES
Deprecated. 
See Also:
Constant Field Values

DRIVER_CLASS_NAME

protected static final java.lang.String DRIVER_CLASS_NAME
Deprecated. 
See Also:
Constant Field Values

JDBC_URL

protected static final java.lang.String JDBC_URL
Deprecated. 
See Also:
Constant Field Values
Constructor Detail

AbstractDriverConnectionPoolDataSource

public AbstractDriverConnectionPoolDataSource()
Deprecated. 
Method Detail

getJdbcUrl

public java.lang.String getJdbcUrl()
Deprecated. 

setJdbcUrl

public void setJdbcUrl(java.lang.String jdbcUrl)
Deprecated. 

getDriverClassName

public java.lang.String getDriverClassName()
Deprecated. 

setDriverClassName

public void setDriverClassName(java.lang.String driverClassName)
Deprecated. 

getProperty

public java.lang.String getProperty(java.lang.String name)
Deprecated. 

setProperty

public void setProperty(java.lang.String name,
                        java.lang.String value)
Deprecated. 

getProperties

public java.util.Properties getProperties()
Deprecated. 

setProperties

public void setProperties(java.util.Properties properties)
Deprecated. 
Set JDBC properties that will be passed when opening a connection.

Parameters:
properties - instance of Properties containing properties of a connection to open.
See Also:
getProperties()

getLogger

protected org.firebirdsql.logging.Logger getLogger()
Deprecated. 
Description copied from class: AbstractConnectionPool
Get logger for this instance. By default all log messages belong to this class. Subclasses can override this behavior.

Specified by:
getLogger in class AbstractConnectionPool
Returns:
instance of Logger.

getLogWriter

public java.io.PrintWriter getLogWriter()
Deprecated. 
Specified by:
getLogWriter in interface javax.sql.CommonDataSource
Specified by:
getLogWriter in class BasicAbstractConnectionPool

setLogWriter

public void setLogWriter(java.io.PrintWriter out)
Deprecated. 
Specified by:
setLogWriter in interface javax.sql.CommonDataSource
Specified by:
setLogWriter in class BasicAbstractConnectionPool

getLoginTimeout

public int getLoginTimeout()
Deprecated. 
Get login timeout.

Specified by:
getLoginTimeout in interface javax.sql.CommonDataSource
Specified by:
getLoginTimeout in class BasicAbstractConnectionPool
Returns:
value set in setLoginTimeout(int) method or 0.

setLoginTimeout

public void setLoginTimeout(int seconds)
Deprecated. 
Set login timeout for new connection. Currently ignored.

Specified by:
setLoginTimeout in interface javax.sql.CommonDataSource
Specified by:
setLoginTimeout in class BasicAbstractConnectionPool
Parameters:
seconds - how long pool should wait until new connection is granted.

getTransactionIsolationLevel

public int getTransactionIsolationLevel()
Deprecated. 

setTransactionIsolationLevel

public void setTransactionIsolationLevel(int transactionIsolation)
Deprecated. 

getIsolation

public java.lang.String getIsolation()
Deprecated. 

setIsolation

public void setIsolation(java.lang.String isolation)
                  throws java.sql.SQLException
Deprecated. 
Throws:
java.sql.SQLException

getConnectionManager

protected PooledConnectionManager getConnectionManager()
                                                throws java.sql.SQLException
Deprecated. 
Get connection manager that will allocate physical connections to the database.

Specified by:
getConnectionManager in class AbstractConnectionPool
Returns:
instance of PooledConnectionManager class.
Throws:
java.sql.SQLException - if connection manager cannot be obtained.

getPoolName

protected java.lang.String getPoolName()
Deprecated. 
Get name of this connection pool.

Specified by:
getPoolName in class AbstractConnectionPool
Returns:
name of the pool, equal to the JDBC URL value.

getPooledConnection

protected PooledObject getPooledConnection(org.firebirdsql.pool.PooledConnectionQueue queue)
                                    throws java.sql.SQLException
Deprecated. 
Get pooled connection from the pooled queue.

Overrides:
getPooledConnection in class AbstractConnectionPool
Parameters:
queue - instance of PooledConnectionQueue where connection will be obtained.
Returns:
instance of PooledObject.
Throws:
java.sql.SQLException - if pooled connection cannot be obtained.

getPooledConnection

public javax.sql.PooledConnection getPooledConnection()
                                               throws java.sql.SQLException
Deprecated. 
Get pooled connection. This method will block until there will be free connection to return.

Specified by:
getPooledConnection in interface javax.sql.ConnectionPoolDataSource
Specified by:
getPooledConnection in class BasicAbstractConnectionPool
Returns:
instance of PooledConnection.
Throws:
java.sql.SQLException - if pooled connection cannot be obtained.

getPooledConnection

public javax.sql.PooledConnection getPooledConnection(java.lang.String user,
                                                      java.lang.String password)
                                               throws java.sql.SQLException
Deprecated. 
Get pooled connection for the specified user name and password.

Specified by:
getPooledConnection in interface javax.sql.ConnectionPoolDataSource
Specified by:
getPooledConnection in class BasicAbstractConnectionPool
Parameters:
user - user name.
password - password corresponding to specified user name.
Returns:
instance of PooledConnection for the specified credentials.
Throws:
java.sql.SQLException - always, this method is not yet implemented.

connectionClosed

public void connectionClosed(javax.sql.ConnectionEvent connectionEvent)
Deprecated. 
Notify about connection being closed.

Specified by:
connectionClosed in interface javax.sql.ConnectionEventListener
Parameters:
connectionEvent - instance of ConnectionEvent.

physicalConnectionClosed

public void physicalConnectionClosed(javax.sql.ConnectionEvent connectionEvent)
Deprecated. 
Notify about physical connection being closed.

Specified by:
physicalConnectionClosed in interface PooledConnectionEventListener
Parameters:
connectionEvent - instance of ConnectionEvent.

physicalConnectionDeallocated

public void physicalConnectionDeallocated(javax.sql.ConnectionEvent connectionEvent)
Deprecated. 
Notify about the deallocation of the physical connection.

Specified by:
physicalConnectionDeallocated in interface PooledConnectionEventListener
Parameters:
connectionEvent - instance of ConnectionEvent.

connectionErrorOccurred

public void connectionErrorOccurred(javax.sql.ConnectionEvent event)
Deprecated. 
Notify about serious error when using the connection. Currently these events are ignored.

Specified by:
connectionErrorOccurred in interface javax.sql.ConnectionEventListener
Parameters:
event - instance of ConnectionEvent containing information about an error.

getFreeSize

public int getFreeSize()
                throws java.sql.SQLException
Deprecated. 
Description copied from class: AbstractConnectionPool
Get number of free connections in this pool. This method returns the number of free open connections to the specified database. It might return 0, but this does not mean that next request will block. This will happen only if getMaxSize() != 0 && getMaxSize() == getWorkingSize(), meaning that we have allocated maximum number of connections and all of them are in use.

Specified by:
getFreeSize in class AbstractConnectionPool
Returns:
number of free connections left.
Throws:
java.sql.SQLException

getTotalSize

public int getTotalSize()
                 throws java.sql.SQLException
Deprecated. 
Description copied from class: AbstractConnectionPool
Get total size of physical connections opened to the database.

Specified by:
getTotalSize in class AbstractConnectionPool
Returns:
total number of opened connections to the database.
Throws:
java.sql.SQLException

getWorkingSize

public int getWorkingSize()
                   throws java.sql.SQLException
Deprecated. 
Description copied from class: AbstractConnectionPool
Get number of connections that are in use.

Specified by:
getWorkingSize in class AbstractConnectionPool
Returns:
number of working connections.
Throws:
java.sql.SQLException

createObjectInstance

protected BasicAbstractConnectionPool createObjectInstance()
Deprecated. 
Create instance of this data source.

Specified by:
createObjectInstance in class BasicAbstractConnectionPool

getDefaultReference

public javax.naming.Reference getDefaultReference()
Deprecated. 
Get default JNDI reference for this instance.

Overrides:
getDefaultReference in class BasicAbstractConnectionPool
Returns:
instance of Reference containing all information that allows to reconstruct the datasource.

processObjectInstance

protected java.lang.Object processObjectInstance(AbstractDriverConnectionPoolDataSource ds,
                                                 java.lang.Object obj)
                                          throws java.lang.Exception
Deprecated. 
Throws:
java.lang.Exception


Copyright © 2001-2019 Jaybird (Firebird JDBC/JCA) team. All rights reserved.