|
||||||||||
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
public class ConnectionManager
A class that acts as a Connection Pool manager. Used when an application connects directly with a database. XUI allows databases and connections to be configured from XML. The connections canthen be used to load tables into the model as DatabaseTableModel or for execution of custom queries at runtime.
Copyright (c) Xoetrope Ltd. 2001-2003
$Revision: 2.3 $ License: see license.txt
Field Summary | |
---|---|
protected static ConnectionManager |
connMgr
|
protected static java.lang.String |
defaultDatabaseUrl
|
protected static java.lang.String |
defaultDriverName
|
protected java.lang.String |
password
|
protected java.lang.String |
url
|
protected java.lang.String |
user
|
Fields inherited from class net.xoetrope.optional.pool.PoolManager |
---|
objects |
Constructor Summary | |
---|---|
protected |
ConnectionManager(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 | |
---|---|
ConnectionObject |
getConnection(java.lang.String connName)
Gets a connection. |
static ConnectionManager |
getInstance()
Deprecated. |
PoolObject |
getNewObject(java.lang.String connName)
Creates a new ConnectionObject, loading the JDBC driver in the process if necessary |
ConnectionManager |
reset(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.pool.PoolManager |
---|
closeObjects, getObject, reapObjects, returnObject |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.lang.String url
protected java.lang.String user
protected java.lang.String password
protected static java.lang.String defaultDriverName
protected static java.lang.String defaultDatabaseUrl
protected static ConnectionManager connMgr
Constructor Detail |
---|
protected ConnectionManager(java.lang.String adriver, java.lang.String aurl, java.lang.String auser, java.lang.String apassword, int size)
adriver
- the database driver nameaurl
- the database connection stringauser
- the database userapassword
- the database passwordsize
- the initial pool sizeMethod Detail |
---|
public PoolObject getNewObject(java.lang.String connName) throws java.sql.SQLException
getNewObject
in class PoolManager
connName
- the connection name, ignored for this the default
connection manager as only a single instance of the default connection is
used.
java.sql.SQLException
- if an connection could not be established, for instance if the driver could
not be loaded and instantiatedpublic static ConnectionManager getInstance()
public ConnectionManager reset(java.lang.String driver, java.lang.String url, java.lang.String userName, java.lang.String password)
driver
- the database driver nameurl
- the database URLuserName
- the user name/account name by which to access the databasepassword
- the database password
public ConnectionObject getConnection(java.lang.String connName) throws java.sql.SQLException
connName
- the connection name or null if none exists
java.sql.SQLException
- possible exceptions while trying to establish the connection.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |