Servertec ConnectionPoolManager
Content
Introduction
Release Notes
Features
FAQs
Requirements
Installation
Add-ons
How To
Change Log
Future Plans
Knowledge Base
Documentation
Conventions
Command Line
Administrator
Localization
Programming
Security
Performance
Deployment
Java API
AccessLogEntry
Codecs
Connection
ConnectionPool...
DString
ErrorLogEntry
EventLogEntry
FileCache
FileUpload
IOHandler
IOManager
iws
Logger
MonitorEvent...
MultiPartForm
QuickSort
Realm
RealmAdmin...
RealmManager
ServletContextImpl
ServletContext...
ServletImpl
ServletManager
SocketHandler
Utils

Servlet API
CGI
SSI
Servlets
Config Files
Log Files
Classes
Directory Tree
Samples
Legal
Contact Us

 

java.lang.Object
 |
 +--stec.sql.ConnectionPoolManager

public final class ConnectionPoolManager

Used to manage access to connection pools. Connection pools can be defined using the Servertec Internet Server Administrator or created using the ConnectionPoolManager.

This class is a wrapper for java.sql.ConnectionPoolManager. It is primarily used to return a connection from an existing connection pool.

Methods

Method Description
containsConnectionPool Returns whether the ConnectionPoolManager contains the specified ConnectionPool.
createConnectionPool Creates a new connection pool.
destroyConnectionPool Removes an existing connection pool.
destroyAllConnectionPools Removes all existing connection pools.
getConnection Returns a connection from the named connection pool.
getConnectionPools Returns an enumeration of the connection pools.

containsConnectionPool

Returns whether the ConnectionPoolManager contains the specified ConnectionPool.

Syntax

public final static boolean containsConnectionPool(String name)

Parameters

name the name of the connection pool.

Returns

boolean whether the ConnectionPoolManager contains the specified ConnectionPool.

Throws

Nothing

Example

boolean found = ConnectionPoolManager.containsConnnectionPool("iob");

createConnectionPool

Creates a new connection pool.

Syntax

public final static void createConnectionPool(String name,
                                              String driver,
                                              String url,
                                              int initSize,
                                              int maxSize)
                                              throws SQLException

public final static void createConnectionPool(String name,
                                              String driver,
                                              String url,
                                              String username,
                                              String password,
                                              int initSize,
                                              int maxSize)
                                              throws SQLException

public final static void createConnectionPool(String name,
                                              String driver,
                                              String url,
                                              Properties info,
                                              int initSize,
                                              int maxSize)
                                              throws SQLException

public final static void createConnectionPool(String name,
                                              String driver,
                                              String url,
                                              int initSize,
                                              int maxSize,
                                              long timeout)
                                              throws SQLException

public final static void createConnectionPool(String name,
                                              String driver,
                                              String url,
                                              String username,
                                              String password,
                                              int initSize,
                                              int maxSize,
                                              long timeout)
                                              throws SQLException

public final static void createConnectionPool(String name,
                                              String driver,
                                              String url,
                                              Properties info,
                                              int initSize,
                                              int maxSize,
                                              long timeout)
                                              throws SQLException

Parameters

name the name of the connection pool.
driver the JDBC driver to the database.
url the url to the database.
username the user's id.
password the user's password.
info any connection arguments, key/value pairs.
initSize the initial number of connections.
maxSize the maximum number of connections.
timeout the number of milliseconds to keep an inactive connection open in the connection pool, -1 is the default.

-1 is used for unlimited.

Returns

Nothing

Throws

SQLException if an error occurs.

Example

ConnectionPoolManager.createConnectionPool
(
    "iob",
    "sun.jdbc.odbc.JdbcOdbcDriver",
    "jdbc:odbc:IOB",
    10,
    20,
    1000L * 60L * 15L
);

destroyConnectionPool

Removes an existing connection pool.

Syntax

public final static void destroyConnectionPool(String name)

Parameters

name the name of a connection pool.

Returns

Nothing

Throws

Nothing

Example

ConnectionPoolManager.destroyConnectionPool("iob");

destroyAllConnectionPools

Removes all existing connection pools.

Syntax

public final static void destroyAllConnectionPools()

Parameters

None

Returns

Nothing

Throws

Nothing

Example

ConnectionPoolManager.destroyAllConnectionPools();

getConnection

Returns a connection from the named connection pool.

Syntax

public final static Connection getConnection(String name)
    throws SQLException

Parameters

name the name of a connection pool.

Returns

Connection the connection. null if all connections are in use.

Throws

SQLException if an error occurs.

Example

Connection con = ConnectionPoolManager.getConnection("iob");

getConnectionPools

Returns an enumeration of the connection pools.

Syntax

public final static Enumeration getConnectionPools()

Parameters

None

Returns

Enumeration the enumeration of the connection pools.

Throws

Nothing

Example

Enumeration e = ConnectionPoolManager.getConnnectionPools();
 top of page
Copyright © 1998-2005 Servertec. All rights reserved.
Privacy Statement.
Last Modified: Sun Sep 04 14:56:49 EDT 2005