public class JdbcConnectionFactory
extends org.apache.avalon.framework.logger.AbstractLogEnabled
implements org.apache.avalon.excalibur.pool.ObjectFactory
| Modifier and Type | Field and Description |
|---|---|
private static java.lang.String |
DEFAULT_KEEPALIVE |
private boolean |
m_autoCommit |
private java.lang.Class |
m_class |
private java.lang.String |
m_connectionClass |
private java.lang.String |
m_dburl |
private java.sql.Connection |
m_firstConnection |
private java.lang.String |
m_keepAlive |
private int |
m_keepAliveAge |
private java.lang.String |
m_password |
private java.lang.String |
m_username |
private static java.lang.String |
ORACLE_KEEPALIVE |
| Constructor and Description |
|---|
JdbcConnectionFactory(java.lang.String url,
java.lang.String username,
java.lang.String password,
boolean autoCommit,
boolean oradb)
Deprecated.
Use the new constructor with the keepalive and connectionClass
specified.
|
JdbcConnectionFactory(java.lang.String url,
java.lang.String username,
java.lang.String password,
boolean autoCommit,
boolean oradb,
java.lang.String connectionClass)
Deprecated.
Use the new constructor with the keepalive and connectionClass
specified.
|
JdbcConnectionFactory(java.lang.String url,
java.lang.String username,
java.lang.String password,
boolean autoCommit,
java.lang.String keepAlive,
int keepAliveAge,
java.lang.String connectionClass)
Creates and configures a new JdbcConnectionFactory.
|
JdbcConnectionFactory(java.lang.String url,
java.lang.String username,
java.lang.String password,
boolean autoCommit,
java.lang.String keepAlive,
java.lang.String connectionClass)
Creates and configures a new JdbcConnectionFactory.
|
| Modifier and Type | Method and Description |
|---|---|
void |
decommission(java.lang.Object object) |
java.lang.Class |
getCreatedClass() |
private java.sql.Connection |
getProxy(java.sql.Connection conn,
java.lang.String keepAlive,
int keepAliveAge) |
private void |
init() |
java.lang.Object |
newInstance() |
private final java.lang.String m_dburl
private final java.lang.String m_username
private final java.lang.String m_password
private final boolean m_autoCommit
private final java.lang.String m_keepAlive
private final int m_keepAliveAge
private final java.lang.String m_connectionClass
private java.lang.Class m_class
private static final java.lang.String DEFAULT_KEEPALIVE
private static final java.lang.String ORACLE_KEEPALIVE
private java.sql.Connection m_firstConnection
public JdbcConnectionFactory(java.lang.String url,
java.lang.String username,
java.lang.String password,
boolean autoCommit,
boolean oradb)
public JdbcConnectionFactory(java.lang.String url,
java.lang.String username,
java.lang.String password,
boolean autoCommit,
boolean oradb,
java.lang.String connectionClass)
public JdbcConnectionFactory(java.lang.String url,
java.lang.String username,
java.lang.String password,
boolean autoCommit,
java.lang.String keepAlive,
java.lang.String connectionClass)
url - full JDBC database url.username - username to use when connecting to the database.password - password to use when connecting to the database.autoCommit - true if connections to the database should operate with auto commit
enabled.keepAlive - a query which will be used to check the statis of a connection after it
has been idle. A null value will cause the keep alive feature to
be disabled.connectionClass - class of connections created by the factory.public JdbcConnectionFactory(java.lang.String url,
java.lang.String username,
java.lang.String password,
boolean autoCommit,
java.lang.String keepAlive,
int keepAliveAge,
java.lang.String connectionClass)
url - full JDBC database url.username - username to use when connecting to the database.password - password to use when connecting to the database.autoCommit - true if connections to the database should operate with auto commit
enabled.keepAlive - a query which will be used to check the statis of a connection after it
has been idle. A null value will cause the keep alive feature to
be disabled.keepAliveAge - the maximum age in milliseconds since a connection was last
used before it must be pinged using the keepAlive query. Ignored
if keepAlive is null.connectionClass - class of connections created by the factory.private void init()
throws java.lang.Exception
java.lang.Exceptionpublic java.lang.Object newInstance()
throws java.lang.Exception
newInstance in interface org.apache.avalon.excalibur.pool.ObjectFactoryjava.lang.Exceptionpublic java.lang.Class getCreatedClass()
getCreatedClass in interface org.apache.avalon.excalibur.pool.ObjectFactorypublic void decommission(java.lang.Object object)
throws java.lang.Exception
decommission in interface org.apache.avalon.excalibur.pool.ObjectFactoryjava.lang.Exceptionprivate java.sql.Connection getProxy(java.sql.Connection conn,
java.lang.String keepAlive,
int keepAliveAge)