|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.jboss.minerva.pools.PoolObjectFactory | +--org.jboss.minerva.factories.JDBCConnectionFactory
Object factory that creates java.sql.Connections. This is meant for use outside a J2EE/JTA environment - servlets alone, client/server, etc. If you're interested in creating transactional-aware connections, see XAConnectionFactory, which complies with the JDBC 2.0 standard extension.
XAConnectionFactory
Constructor Summary | |
JDBCConnectionFactory()
Creates a new factory. |
Method Summary | |
java.lang.Object |
createObject()
Creates a new JDBC Connection. |
void |
deleteObject(java.lang.Object pooledObject)
Closes a connection. |
java.util.Properties |
getConnectProperties()
Gets the JDBC Properties used to create new connections. |
java.lang.String |
getConnectURL()
Gets the JDBC URL used to create new connections. |
java.lang.String |
getPassword()
Gets the JDBC password used to create new connections. |
java.lang.String |
getUser()
Gets the JDBC user name used to create new connections. |
void |
poolClosing(ObjectPool pool)
Cleans up. |
void |
poolStarted(ObjectPool pool,
java.io.PrintWriter log)
Validates that connection properties were set (at least a URL). |
java.lang.Object |
prepareObject(java.lang.Object pooledObject)
Wraps the connection with a ConnectionInPool. |
java.lang.Object |
returnObject(java.lang.Object clientObject)
Closes all outstanding work for the connection, rolls it back, and returns the underlying connection to the pool. |
void |
setConnectProperties(java.util.Properties props)
Sets the JDBC Propeties used to create new connections. |
void |
setConnectURL(java.lang.String url)
Sets the JDBC URL used to create new connections. |
void |
setPassword(java.lang.String password)
Sets the JDBC password used to create new connections. |
void |
setUser(java.lang.String userName)
Sets the JDBC user name used to create new connections. |
java.lang.Object |
translateObject(java.lang.Object clientObject)
Returns the original connection from a ConnectionInPool. |
Methods inherited from class org.jboss.minerva.pools.PoolObjectFactory |
isUniqueRequest |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public JDBCConnectionFactory()
Method Detail |
public void setConnectURL(java.lang.String url)
public java.lang.String getConnectURL()
public void setConnectProperties(java.util.Properties props)
public java.util.Properties getConnectProperties()
public void setUser(java.lang.String userName)
public java.lang.String getUser()
public void setPassword(java.lang.String password)
public java.lang.String getPassword()
public void poolStarted(ObjectPool pool, java.io.PrintWriter log)
poolStarted
in class PoolObjectFactory
org.jboss.minerva.pools.PoolObjectFactory
pool
- The pool that is starting. You may decide to allow
multiple pools you use your factory, or to restrict it to a one-to-one
relationship.log
- A writer you can use to log messages. Use this in preference
to System.xxx.println.java.lang.IllegalArgumentException
- Occurs when the pool is null.public void poolClosing(ObjectPool pool)
poolClosing
in class PoolObjectFactory
org.jboss.minerva.pools.PoolObjectFactory
pool
- The pool that is closing. You may decide to allow
multiple pools you use your factory, or to restrict it to a one-to-one
relationship.java.lang.IllegalArgumentException
- Occurs when the pool is null.public java.lang.Object createObject()
createObject
in class PoolObjectFactory
org.jboss.minerva.pools.PoolObjectFactory
PoolObjectFactory.prepareObject(java.lang.Object)
public java.lang.Object prepareObject(java.lang.Object pooledObject)
prepareObject
in class PoolObjectFactory
ConnectionInPool
public java.lang.Object translateObject(java.lang.Object clientObject)
translateObject
in class PoolObjectFactory
ConnectionInPool
public java.lang.Object returnObject(java.lang.Object clientObject)
returnObject
in class PoolObjectFactory
org.jboss.minerva.pools.PoolObjectFactory
clientObject
- The client object, as returned by prepareObjectpublic void deleteObject(java.lang.Object pooledObject)
deleteObject
in class PoolObjectFactory
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |