|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.xoetrope.optional.pool.PoolManager
net.xoetrope.optional.data.sql.ConnectionManager
net.xoetrope.optional.data.sql.NamedConnectionManager
public class NamedConnectionManager
An extension of the ConnectionManager to manage connections to multiple databases
Copyright: Copyright (c) 2003
License: see license.txt
| Field Summary | |
|---|---|
protected java.util.Vector |
connectionParameters
Storage for the various connection parameters |
| Fields inherited from class net.xoetrope.optional.data.sql.ConnectionManager |
|---|
connMgr, defaultDatabaseUrl, defaultDriverName, password, url, user |
| Fields inherited from class net.xoetrope.optional.pool.PoolManager |
|---|
objects |
| Constructor Summary | |
|---|---|
protected |
NamedConnectionManager(java.lang.String name,
java.lang.String aDriver,
java.lang.String aurl,
java.lang.String auser,
java.lang.String apassword,
int size)
Constructs a new ConnectionManager, called by getInstance |
| Method Summary | |
|---|---|
void |
addConnection(java.lang.String name,
java.lang.String driver,
java.lang.String url,
java.lang.String userName,
java.lang.String password)
Gets an instance of the ConnectionManager. |
protected java.lang.Object |
findConnectionParams(java.lang.String connParamName)
Find a nameds set of connection parameters |
ConnectionObject |
getConnection(java.lang.String connectionName)
Gets a connection. |
java.lang.String[] |
getConnectionParams(java.lang.String connParamName)
Get the connection parameters |
static ConnectionManager |
getInstance()
Deprecated. |
PoolObject |
getNewObject(java.lang.String connParamName)
Creates a new ConnectionObject, loading the JDBC driver in the process if necessary |
PoolObject |
getObject(java.lang.String connParamName)
Get a new object from the pool. |
ConnectionManager |
reset(java.lang.String name,
java.lang.String driver,
java.lang.String url,
java.lang.String userName,
java.lang.String password)
Gets an instance of the ConnectionManager. |
| Methods inherited from class net.xoetrope.optional.data.sql.ConnectionManager |
|---|
reset |
| Methods inherited from class net.xoetrope.optional.pool.PoolManager |
|---|
closeObjects, reapObjects, returnObject |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.util.Vector connectionParameters
| Constructor Detail |
|---|
protected NamedConnectionManager(java.lang.String name,
java.lang.String aDriver,
java.lang.String aurl,
java.lang.String auser,
java.lang.String apassword,
int size)
name - the name of the connection to useaDriver - the name of the driver to useaurl - the database connection stringauser - the database userapassword - the database passwordsize - the initial pool size| Method Detail |
|---|
public PoolObject getObject(java.lang.String connParamName)
throws java.lang.Exception
getObject in class PoolManagerconnParamName - the name of the connection parameters
java.lang.Exception
public PoolObject getNewObject(java.lang.String connParamName)
throws java.sql.SQLException
getNewObject in class ConnectionManagerconnParamName - the connection name, ignored for this the default
connection manager as only a single instance of the default connection is
used.
java.sql.SQLExceptionpublic static ConnectionManager getInstance()
public ConnectionObject getConnection(java.lang.String connectionName)
throws java.sql.SQLException
getConnection in class ConnectionManagerconnectionName - the name of the connection object
java.sql.SQLException
public void addConnection(java.lang.String name,
java.lang.String driver,
java.lang.String url,
java.lang.String userName,
java.lang.String password)
name - the name by which the connection paramenters will be referenceddriver - the driver class nameurl - the database URLuserName - the user namepassword - the passwordprotected java.lang.Object findConnectionParams(java.lang.String connParamName)
connParamName - the name of the set of connection parameters
public ConnectionManager reset(java.lang.String name,
java.lang.String driver,
java.lang.String url,
java.lang.String userName,
java.lang.String password)
name - the name of the connection being requesteddriver - the driver to be useduserName - the database userpassword - the users password
public java.lang.String[] getConnectionParams(java.lang.String connParamName)
connParamName - the name of the set of connection parameters
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||