org.jtools.jpool.system
Class PoolConfig

java.lang.Object
  extended byorg.jtools.jpool.system.PoolConfig

public class PoolConfig
extends java.lang.Object

 PoolConfig Class
 This class represents the values used to set up the connections to one database. The
 default values are used in case the these were not specified in the xml configuration
 file. These class are created when the parsing of the xml configuration class takes places.
 On creation of the database pools each of them will have their own configuration object.
 Based upon the values of this object the behaviour of the pool can be different for
 one of them.
 

Version:
$Id: PoolConfig.java,v 1.1 2003/10/15 15:37:31 stfndln Exp $
Author:
Stefaan Delanghe (stfndln@yahoo.com)

Field Summary
static long DEFAULT_EXPIRE
          The maximum time a connection may not be used.
static int DEFAULT_MAXCONN
          default maximum number of connections to the database.
static int DEFAULT_MINCONN
          default initial number of connection to the database
static long DEFAULT_TIMEOUT
          The maximum time for which you will wait to retrieve a connection from the pool
 
Constructor Summary
PoolConfig()
          Default Constructor from which the default values are set.
 
Method Summary
 java.lang.String getDatabaseURL()
          Retrieves the database url which defines the database to connect to.
 java.lang.String getDriver()
          Retrieves the jdbc driver to use in order to establish a connection with the database.
 long getExpire()
          Retrieves the maximum time a pooled connection may be inactive
 int getMaxConnection()
          Retrieves the maximum number of connection established for the database pool
 int getMinConnection()
          Retrieves the initial number of connections established for database pool
 java.lang.String getName()
          Retrieves the name of the database pool as specified in the xml configuration file.
 char[] getPassword()
          Retrieves the password to authenticate to the database
 long getTimeout()
          Retrieves the maximum time to wait for a pooled connection.
 java.lang.String getUsername()
          Retrieves the usename to authenticate to the database
 void setDatabaseURL(java.lang.String _databaseurl)
          Sets the database url which defines to which database you want to connect
 void setDriver(java.lang.String _driver)
          Sets the jdbc driver in order to establish connections with the database
 void setExpire(long _expire)
          Sets the maximum time a pooled connections may be inactive
 void setMaxConnection(int _maxconn)
          Sets the maximum number of connections that may be requested simultaniously
 void setMinConnection(int _minconn)
          Sets the initial number of connections to be created
 void setName(java.lang.String _name)
          Sets the database name as specified in the xml configuration.
 void setPassword(char[] _password)
          Sets the password to authenticate to the database
 void setTimeout(long _timeout)
          Sets the maximum time to wait to retrieve a pooled connection
 void setUsername(java.lang.String _username)
          Sets the username to authenticate to the database
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_MINCONN

public static final int DEFAULT_MINCONN
default initial number of connection to the database

See Also:
Constant Field Values

DEFAULT_MAXCONN

public static final int DEFAULT_MAXCONN
default maximum number of connections to the database. 0 means that there can be an unlimited number of connections

See Also:
Constant Field Values

DEFAULT_TIMEOUT

public static final long DEFAULT_TIMEOUT
The maximum time for which you will wait to retrieve a connection from the pool

See Also:
Constant Field Values

DEFAULT_EXPIRE

public static final long DEFAULT_EXPIRE
The maximum time a connection may not be used. Once passed this time the connection will be deleted from the pool

See Also:
Constant Field Values
Constructor Detail

PoolConfig

public PoolConfig()
Default Constructor from which the default values are set.

Method Detail

getName

public java.lang.String getName()
Retrieves the name of the database pool as specified in the xml configuration file.

Returns:
The database name

getDriver

public java.lang.String getDriver()
Retrieves the jdbc driver to use in order to establish a connection with the database.

Returns:
The jdbc driver

getDatabaseURL

public java.lang.String getDatabaseURL()
Retrieves the database url which defines the database to connect to.

Returns:
The database url

getUsername

public java.lang.String getUsername()
Retrieves the usename to authenticate to the database

Returns:
The username

getPassword

public char[] getPassword()
Retrieves the password to authenticate to the database

Returns:
The password

getMinConnection

public int getMinConnection()
Retrieves the initial number of connections established for database pool

Returns:
The initial number of connections

getMaxConnection

public int getMaxConnection()
Retrieves the maximum number of connection established for the database pool

Returns:
The maximum number of connections

getTimeout

public long getTimeout()
Retrieves the maximum time to wait for a pooled connection.

Returns:
The maximum time to wait

getExpire

public long getExpire()
Retrieves the maximum time a pooled connection may be inactive

Returns:
The maximum time for a connection to be inactive

setName

public void setName(java.lang.String _name)
Sets the database name as specified in the xml configuration. With this value you will access the correct pool.

Parameters:
_name - The name of the database

setDriver

public void setDriver(java.lang.String _driver)
Sets the jdbc driver in order to establish connections with the database

Parameters:
_driver - The jdbc driver

setDatabaseURL

public void setDatabaseURL(java.lang.String _databaseurl)
Sets the database url which defines to which database you want to connect

Parameters:
_databaseurl - The database url

setUsername

public void setUsername(java.lang.String _username)
Sets the username to authenticate to the database

Parameters:
_username - The username

setPassword

public void setPassword(char[] _password)
Sets the password to authenticate to the database

Parameters:
_password - The password

setMinConnection

public void setMinConnection(int _minconn)
Sets the initial number of connections to be created

Parameters:
_minconn - The initial number of connections

setMaxConnection

public void setMaxConnection(int _maxconn)
Sets the maximum number of connections that may be requested simultaniously

Parameters:
_maxconn - The maximum number of connections

setTimeout

public void setTimeout(long _timeout)
Sets the maximum time to wait to retrieve a pooled connection

Parameters:
_timeout - The maximum time to wait

setExpire

public void setExpire(long _expire)
Sets the maximum time a pooled connections may be inactive

Parameters:
_expire - The maximum time for a inactive connection