|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.firebirdsql.pool.AbstractConnectionPool
org.firebirdsql.pool.BasicAbstractConnectionPool
org.firebirdsql.pool.DriverConnectionPoolDataSource
Generic implementation of ConnectionPoolDataSource that
uses DriverManager to open physical connections to the
database.
| Nested Class Summary |
| Nested classes inherited from class org.firebirdsql.pool.AbstractConnectionPool |
AbstractConnectionPool.UserPasswordPair |
| Field Summary | |
static AbstractConnectionPool.UserPasswordPair |
EMPTY_USER_PASSWORD
|
| Constructor Summary | |
DriverConnectionPoolDataSource()
Create instance of this class. |
|
| Method Summary | |
void |
connectionClosed(javax.sql.ConnectionEvent connectionEvent)
Notify about connection being closed. |
void |
connectionErrorOccurred(javax.sql.ConnectionEvent event)
Notify about serious error when using the connection. |
protected BasicAbstractConnectionPool |
createObjectInstance()
Create instance of this data source. |
protected PooledConnectionManager |
getConnectionManager()
Get connection manager that will allocate physical connections to the database. |
javax.naming.Reference |
getDefaultReference()
Get default JNDI reference for this instance. |
java.lang.String |
getDriverClassName()
|
int |
getFreeSize()
Get number of free connections in this pool. |
java.lang.String |
getJdbcUrl()
|
protected org.firebirdsql.logging.Logger |
getLogger()
Get logger for this instance. |
int |
getLoginTimeout()
Get login timeout. |
java.io.PrintWriter |
getLogWriter()
|
java.lang.Object |
getObjectInstance(java.lang.Object obj,
javax.naming.Name name,
javax.naming.Context nameCtx,
java.util.Hashtable environment)
Get object instance for the specified name in the specified context. |
javax.sql.PooledConnection |
getPooledConnection()
Get pooled connection. |
protected PooledObject |
getPooledConnection(org.firebirdsql.pool.PooledConnectionQueue queue)
Get pooled connection from the pooled queue. |
javax.sql.PooledConnection |
getPooledConnection(java.lang.String user,
java.lang.String password)
Get pooled connection for the specified user name and password. |
protected java.lang.String |
getPoolName()
Get name of this connection pool. |
java.util.Properties |
getProperties()
|
java.lang.String |
getProperty(java.lang.String name)
|
int |
getTotalSize()
Get total size of physical connections opened to the database. |
int |
getWorkingSize()
Get number of connections that are in use. |
void |
physicalConnectionClosed(javax.sql.ConnectionEvent connectionEvent)
Notify about physical connection being closed. |
void |
physicalConnectionDeallocated(javax.sql.ConnectionEvent connectionEvent)
Notify about the deallocation of the physical connection. |
void |
setDriverClassName(java.lang.String driverClassName)
|
void |
setJdbcUrl(java.lang.String jdbcUrl)
|
void |
setLoginTimeout(int seconds)
Set login timeout for new connection. |
void |
setLogWriter(java.io.PrintWriter out)
|
void |
setProperties(java.util.Properties properties)
Set JDBC properties that will be passed when opening a connection. |
void |
setProperty(java.lang.String name,
java.lang.String value)
|
| Methods inherited from class org.firebirdsql.pool.AbstractConnectionPool |
finalize, getQueue, physicalConnectionDeallocated, pooledObjectReleased, shutdown |
| Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final AbstractConnectionPool.UserPasswordPair EMPTY_USER_PASSWORD
| Constructor Detail |
public DriverConnectionPoolDataSource()
| Method Detail |
public java.lang.String getJdbcUrl()
public void setJdbcUrl(java.lang.String jdbcUrl)
public java.lang.String getDriverClassName()
public void setDriverClassName(java.lang.String driverClassName)
public java.lang.String getProperty(java.lang.String name)
public void setProperty(java.lang.String name,
java.lang.String value)
public java.util.Properties getProperties()
public void setProperties(java.util.Properties properties)
properties - instance of Properties containing properties
of a connection to open.getProperties()protected org.firebirdsql.logging.Logger getLogger()
AbstractConnectionPool
getLogger in class AbstractConnectionPoolLogger.public java.io.PrintWriter getLogWriter()
getLogWriter in interface javax.sql.ConnectionPoolDataSourcegetLogWriter in class BasicAbstractConnectionPoolpublic void setLogWriter(java.io.PrintWriter out)
setLogWriter in interface javax.sql.ConnectionPoolDataSourcesetLogWriter in class BasicAbstractConnectionPoolpublic int getLoginTimeout()
getLoginTimeout in interface javax.sql.ConnectionPoolDataSourcegetLoginTimeout in class BasicAbstractConnectionPoolsetLoginTimeout(int) method or 0.public void setLoginTimeout(int seconds)
setLoginTimeout in interface javax.sql.ConnectionPoolDataSourcesetLoginTimeout in class BasicAbstractConnectionPoolseconds - how long pool should wait until new connection is
granted.
protected PooledConnectionManager getConnectionManager()
throws java.sql.SQLException
getConnectionManager in class AbstractConnectionPoolPooledConnectionManager class.
java.sql.SQLException - if connection manager cannot be obtained.protected java.lang.String getPoolName()
getPoolName in class AbstractConnectionPool
protected PooledObject getPooledConnection(org.firebirdsql.pool.PooledConnectionQueue queue)
throws java.sql.SQLException
getPooledConnection in class AbstractConnectionPoolqueue - instance of PooledConnectionQueue where connection
will be obtained.
PooledObject.
java.sql.SQLException - if pooled connection cannot be obtained.
public javax.sql.PooledConnection getPooledConnection()
throws java.sql.SQLException
getPooledConnection in interface javax.sql.ConnectionPoolDataSourcegetPooledConnection in class BasicAbstractConnectionPoolPooledConnection.
java.sql.SQLException - if pooled connection cannot be obtained.
public javax.sql.PooledConnection getPooledConnection(java.lang.String user,
java.lang.String password)
throws java.sql.SQLException
getPooledConnection in interface javax.sql.ConnectionPoolDataSourcegetPooledConnection in class BasicAbstractConnectionPooluser - user name.password - password corresponding to specified user name.
PooledConnection for the specified
credentials.
java.sql.SQLException - always, this method is not yet implemented.public void connectionClosed(javax.sql.ConnectionEvent connectionEvent)
connectionClosed in interface javax.sql.ConnectionEventListenerconnectionEvent - instance of ConnectionEvent.public void physicalConnectionClosed(javax.sql.ConnectionEvent connectionEvent)
physicalConnectionClosed in interface PooledConnectionEventListenerconnectionEvent - instance of ConnectionEvent.public void physicalConnectionDeallocated(javax.sql.ConnectionEvent connectionEvent)
physicalConnectionDeallocated in interface PooledConnectionEventListenerconnectionEvent - instance of ConnectionEvent.public void connectionErrorOccurred(javax.sql.ConnectionEvent event)
connectionErrorOccurred in interface javax.sql.ConnectionEventListenerevent - instance of ConnectionEvent containing
information about an error.
public int getFreeSize()
throws java.sql.SQLException
AbstractConnectionPoolgetMaxSize() != 0 && getMaxSize() == getWorkingSize(),
meaning that we have allocated maximum number of connections and all
of them are in use.
getFreeSize in class AbstractConnectionPooljava.sql.SQLException
public int getTotalSize()
throws java.sql.SQLException
AbstractConnectionPool
getTotalSize in class AbstractConnectionPooljava.sql.SQLException
public int getWorkingSize()
throws java.sql.SQLException
AbstractConnectionPool
getWorkingSize in class AbstractConnectionPooljava.sql.SQLExceptionprotected BasicAbstractConnectionPool createObjectInstance()
createObjectInstance in class BasicAbstractConnectionPool
public java.lang.Object getObjectInstance(java.lang.Object obj,
javax.naming.Name name,
javax.naming.Context nameCtx,
java.util.Hashtable environment)
throws java.lang.Exception
getObjectInstance in interface javax.naming.spi.ObjectFactorygetObjectInstance in class BasicAbstractConnectionPooljava.lang.Exceptionpublic javax.naming.Reference getDefaultReference()
getDefaultReference in class BasicAbstractConnectionPoolReference containing all information
that allows to reconstruct the datasource.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||