All Packages Class Hierarchy This Package Previous Next Index
Class com.imaginary.sql.msql.MsqlPooledDataSource
com.imaginary.sql.msql.MsqlDataSource
|
+----com.imaginary.sql.msql.MsqlPooledDataSource
- public final class MsqlPooledDataSource
- extends MsqlDataSource
The mSQL-JDBC implementation of the JDBC 2.0 standard extension
connection pooling API. Connection pooling is actually something
transparent to application developers. It is configured in the
JNDI directory storing this class instead of MsqlDataSource
.
The result is a data source with a pool of connections up to a specified
maxPoolSize
value. If a connection is requested after the
pool has reached its max size, the MsqlPooledDataSource
implementation will wait until one of the in-use connections is
released. In addition to maxPoolSize
, you should also
configure the directory entry with the attributes of a
MsqlDataSource
.
Last modified $Date: 1999/07/09 23:16:33 $
- Version:
- $Revision: 1.1.2.1 $
- Author:
- George Reese (borg@imaginary.com)
-
MsqlPooledDataSource()
- Constructs a new pooled data source.
-
connectionClosed(ConnectionEvent)
- This method is called whenever a pooled connection that is in
used gets closed.
-
connectionErrorOccurred(ConnectionEvent)
- This method is called whenever errors occur to a pooled
connection.
-
getConnection(Properties)
-
-
getMaxPoolSize()
-
-
getPooledConnection()
- Constructs a pooled connection using the default user/password.
-
getPooledConnection(String, String)
-
-
getReference()
- Creates a reference to this object.
-
setMaxPoolSize(int)
- Sets the maximum size for the connection pool.
MsqlPooledDataSource
public MsqlPooledDataSource()
- Constructs a new pooled data source.
connectionClosed
public synchronized void connectionClosed(ConnectionEvent event)
- This method is called whenever a pooled connection that is in
used gets closed.
- Parameters:
- event - the closing event
connectionErrorOccurred
public synchronized void connectionErrorOccurred(ConnectionEvent event)
- This method is called whenever errors occur to a pooled
connection.
- Parameters:
- event - the error event
getConnection
protected Connection getConnection(Properties p) throws SQLException
- Returns:
- a pooled connection using the specified properties
- Overrides:
- getConnection in class MsqlDataSource
getMaxPoolSize
public int getMaxPoolSize()
- Returns:
- the maximum size of the connection pool
getPooledConnection
public PooledConnection getPooledConnection() throws SQLException
- Constructs a pooled connection using the default user/password.
- Returns:
- a database connection
getPooledConnection
public PooledConnection getPooledConnection(String uid,
String pw) throws SQLException
- Parameters:
- uid - the user ID for the connection
- pw - the password for the connection
- Returns:
- a database connection
getReference
public Reference getReference() throws NamingException
- Creates a reference to this object.
- Returns:
- the reference
- Overrides:
- getReference in class MsqlDataSource
setMaxPoolSize
public void setMaxPoolSize(int sz)
- Sets the maximum size for the connection pool.
- Parameters:
- sz - the max size
All Packages Class Hierarchy This Package Previous Next Index