de.mguennewig.pobjects.optional
Class BasicContainerPool

java.lang.Object
  extended by de.mguennewig.pobjects.jdbc.ContainerPool
      extended by de.mguennewig.pobjects.optional.BasicContainerPool

public class BasicContainerPool
extends ContainerPool

A JDBC container pool using the Apache DBCP data source.

Author:
Michael Günnewig
See Also:
BasicDataSource

Constructor Summary
BasicContainerPool(java.lang.String containerClassName, java.lang.String hostname, java.lang.Integer portNumber, java.lang.String database, java.lang.String username, java.lang.String password, PObjDictionary dict, java.lang.String schema)
          Creates a new BasicContainerPool.
 
Method Summary
 void addConnectionProperties(java.util.Properties properties)
           
 int getMaxActive()
          Returns the maximum number of active connections that can be borrowed from this pool.
 void setInitialSize(int initialSize)
          Sets the initial number of connections that will be opened.
 void setMaxActive(int maxActive)
          Sets the maximum number of active connections that can be borrows from this pool.
 void setMaxIdle(int maxIdle)
          Sets the maximum number of connections that will kept idle within the pool.
 void setMaxWait(long maxWait)
          Sets the maximum time in milliseconds that will be waited to borrow a connection from this pool before failing.
 void setMinIdle(int minIdle)
          Sets the minimum number of connections that will kept idle within the pool.
 
Methods inherited from class de.mguennewig.pobjects.jdbc.ContainerPool
freeConnection, freeContainer, getConnection, getContainer, getDictionary, getSchema
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicContainerPool

public BasicContainerPool(java.lang.String containerClassName,
                          java.lang.String hostname,
                          java.lang.Integer portNumber,
                          java.lang.String database,
                          java.lang.String username,
                          java.lang.String password,
                          PObjDictionary dict,
                          java.lang.String schema)
                   throws java.lang.ClassNotFoundException
Creates a new BasicContainerPool.

Throws:
java.lang.ClassNotFoundException
Method Detail

addConnectionProperties

public void addConnectionProperties(java.util.Properties properties)

setInitialSize

public final void setInitialSize(int initialSize)
Sets the initial number of connections that will be opened.

See Also:
BasicDataSource.setInitialSize(int)

getMaxActive

public final int getMaxActive()
Returns the maximum number of active connections that can be borrowed from this pool.

See Also:
setMaxActive(int), BasicDataSource.getMaxActive()

setMaxActive

public final void setMaxActive(int maxActive)
Sets the maximum number of active connections that can be borrows from this pool.

See Also:
getMaxActive(), BasicDataSource.setMaxActive(int)

setMaxWait

public final void setMaxWait(long maxWait)
Sets the maximum time in milliseconds that will be waited to borrow a connection from this pool before failing.

See Also:
BasicDataSource.setMaxWait(long)

setMaxIdle

public final void setMaxIdle(int maxIdle)
Sets the maximum number of connections that will kept idle within the pool.

See Also:
setMinIdle(int), BasicDataSource.setMaxIdle(int)

setMinIdle

public final void setMinIdle(int minIdle)
Sets the minimum number of connections that will kept idle within the pool.

See Also:
setMaxIdle(int), BasicDataSource.setMinIdle(int)