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)

Constructor Index

 o MsqlPooledDataSource()
Constructs a new pooled data source.

Method Index

 o connectionClosed(ConnectionEvent)
This method is called whenever a pooled connection that is in used gets closed.
 o connectionErrorOccurred(ConnectionEvent)
This method is called whenever errors occur to a pooled connection.
 o getConnection(Properties)
 o getMaxPoolSize()
 o getPooledConnection()
Constructs a pooled connection using the default user/password.
 o getPooledConnection(String, String)
 o getReference()
Creates a reference to this object.
 o setMaxPoolSize(int)
Sets the maximum size for the connection pool.

Constructors

 o MsqlPooledDataSource
 public MsqlPooledDataSource()
Constructs a new pooled data source.

Methods

 o 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
 o connectionErrorOccurred
 public synchronized void connectionErrorOccurred(ConnectionEvent event)
This method is called whenever errors occur to a pooled connection.

Parameters:
event - the error event
 o getConnection
 protected Connection getConnection(Properties p) throws SQLException
Returns:
a pooled connection using the specified properties
Overrides:
getConnection in class MsqlDataSource
 o getMaxPoolSize
 public int getMaxPoolSize()
Returns:
the maximum size of the connection pool
 o getPooledConnection
 public PooledConnection getPooledConnection() throws SQLException
Constructs a pooled connection using the default user/password.

Returns:
a database connection
 o 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
 o getReference
 public Reference getReference() throws NamingException
Creates a reference to this object.

Returns:
the reference
Overrides:
getReference in class MsqlDataSource
 o 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