|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.neoworks.connectionpool.PoolManager
Connection pool manager.
Method Summary | |
static void |
configure(org.w3c.dom.Element config)
Configure the PoolManager from a DOM Element |
static void |
configure(org.w3c.dom.Element config,
java.lang.String xpath)
Configure the PoolManager from a DOM Element, using a specific XPath query |
java.sql.Connection |
getConnection(java.lang.String name)
Return a connection from the pool identified by the given string. |
static PoolManager |
getInstance()
Return the static instance of this class. |
void |
loadConfig(org.w3c.dom.Element configroot)
Initialise the database pool with the XML node passed, which should be of the form: |
void |
loadConfig(java.io.InputStream is)
Configures the instance by reading properties from a given input stream, instantiating drivers and connection pools. |
void |
release()
Clean up resources used by this class. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static PoolManager getInstance()
null
if there was a problem reading the properties file, setting up the connection pools and registering drives..public static void configure(org.w3c.dom.Element config)
config
- The DOM Element to configure frompublic static void configure(org.w3c.dom.Element config, java.lang.String xpath)
config
- The DOM Element to configure fromxpath
- The XPath query to usepublic void loadConfig(org.w3c.dom.Element configroot)
<databasepool> <driver classname="org.mydriver.whatever" /> ... <pool name="poolname" url="jdbc url of database" user="username to connect to database" password="" maxconns="maximum connections to reach" initconns="initial connections to open" logintimeout="timeout for login to database" /> ... </databasepool>
public void loadConfig(java.io.InputStream is) throws java.io.IOException, java.lang.ClassNotFoundException, java.lang.InstantiationException, java.lang.IllegalAccessException, java.sql.SQLException
Ensure that any resources that are currently allocated are cleaned up, re-read the properties file, register drivers and set up connection pools.
is
- The InputStream
to load the properties from.
java.io.IOException
- If there was a problem loading the properties from the specified InputStream
.
java.lang.ClassNotFoundException
- If there was a problem loading one of the driver classes.
java.lang.InstantiationException
- If there was a problem instantiating one of the drivers.
java.lang.IllegalAccessException
- If there was a problem accessing the class file of one of the drivers.
java.sql.SQLException
- If there was a problem registering a driver.public void release() throws java.sql.SQLException
java.sql.SQLException
- If there was a problem deregistering one of the drivers.public java.sql.Connection getConnection(java.lang.String name) throws java.sql.SQLException
name
- The string identifier of the connection pool from which we want the connection.
java.sql.SQLException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |