|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.jetspeed.components.datasource.DBCPDatasourceComponent
public class DBCPDatasourceComponent
DBCPDatasourceComponent
Field Summary | |
---|---|
private String |
connectURI
|
protected org.apache.commons.dbcp.PoolingDataSource |
dataSource
|
private String |
driverName
|
private org.apache.commons.dbcp.PoolableConnectionFactory |
dsConnectionFactory
|
private static org.apache.commons.logging.Log |
log
|
private int |
maxActive
|
private int |
maxWait
|
private String |
password
|
private String |
user
|
private byte |
whenExhausted
|
Constructor Summary | |
---|---|
DBCPDatasourceComponent(String user,
String password,
String driverName,
String connectURI,
int maxActive,
int maxWait,
byte whenExhausted,
boolean autoCommit)
Creates a simple commons DBCP connection pool using the following parameters. |
Method Summary | |
---|---|
DataSource |
getDatasource()
getDatasource |
void |
start()
start |
void |
stop()
stop |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final org.apache.commons.logging.Log log
protected org.apache.commons.dbcp.PoolingDataSource dataSource
private String user
private String password
private String driverName
private String connectURI
private int maxActive
private int maxWait
private byte whenExhausted
private org.apache.commons.dbcp.PoolableConnectionFactory dsConnectionFactory
Constructor Detail |
---|
public DBCPDatasourceComponent(String user, String password, String driverName, String connectURI, int maxActive, int maxWait, byte whenExhausted, boolean autoCommit)
If you need to bind the datasource of this component to JNDI please @see org.apache.jetspeed.components.jndi.JNDIComponent
user
- User name that will be used to connect to the DBpassword
- Password that will be used to connect to the DBdriverName
- Fully qualified driver to be used by the connection poolconnectURI
- Fully qualified URI to the DB.maxActive
- Maximum active connectionmaxWait
- if whenExhausted
is set to GenericObjectPool.WHEN_EXHAUSTED_BLOCK
the length of time to block while waiting for a connection to become
available.whenExhausted
- GenericObjectPool.WHEN_EXHAUSTED_BLOCK, GenericObjectPool.WHEN_EXHAUSTED_GROW or
GenericObjectPool.WHEN_EXHAUSTED_FAIL. @see org.apache.commons.pooling.GenericObjectPool
for more information on these settingsautoCommit
- Whether or not this datasource will autocommit
ClassNotFoundException
- If the driverName
could not be
located within any classloaders.Method Detail |
---|
public DataSource getDatasource()
getDatasource
returns the datasource created by this component
getDatasource
in interface DatasourceComponent
public void start()
start
org.picocontainer.Startable#start()
public void stop()
stop
org.picocontainer.Startable#stop()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |