com.raritantechnologies.searchApp.database
Class JNDIConnectionManager
java.lang.Object
com.raritantechnologies.searchApp.database.JNDIConnectionManager
- All Implemented Interfaces:
- IConfigurable, IDatabaseConnectionManager
- public class JNDIConnectionManager
- extends java.lang.Object
- implements IDatabaseConnectionManager
Database connection manager that uses the jdk 1.4 DataSource and JNDI Contexts to
provide connection management and connection pooling.
XML Configuration Template:
<SystemObject type="DatabaseConnectionManager" name="[my name]"
class="com.raritantechnologies.searchApp.database.JNDIConnectionManager"
initalContextFactory="[JNDI Initial Context Factory classname]"
envContext="[JNDI name for Initial context]"
dataSourceName="[JNDI Data Source name]" />
WEBLOGIC sample:
<SystemObject type="DatabaseConnectionManager"
name="jdbcPrefs"
class="com.raritantechnologies.searchApp.database.JNDIConnectionManager"
initialContextFactory="weblogic.jndi.WLInitialContextFactory"
dataSourceName="jdbcPREFS" />
TOMCAT sample
<SystemObject type="DatabaseConnectionManager"
name="jdbcPrefs"
class="com.raritantechnologies.searchApp.database.JNDIConnectionManager"
envContext="java:/comp/env"
dataSourceName="jdbc/PREFS" />
- envContext is required for Tomcat (e.g. java:/comp/env),
but not required for Weblogic
- initialContextFactory is not required for Tomcat (the default works fine).
It may or may not be required for weblogic, the above class works.
- NOTE: for tomcat, you may need the classes12.zip in your classpath.
Developed by
Raritan Technologies .
- Author:
- Ted Sullivan, Glenn Robitaille
|
Method Summary |
java.sql.Connection |
getConnection()
|
void |
initialize(org.w3c.dom.Element elem)
Initializes the object from an XML tag or element. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JNDIConnectionManager
public JNDIConnectionManager()
getConnection
public java.sql.Connection getConnection()
throws java.sql.SQLException
- Specified by:
getConnection in interface IDatabaseConnectionManager
- Throws:
java.sql.SQLException
initialize
public void initialize(org.w3c.dom.Element elem)
- Description copied from interface:
IConfigurable
- Initializes the object from an XML tag or element.
This method is called by the Framework as part of the application initializtion.
see ConfigurationManager, XMLConfigurationManager, XMLSearchFieldMapFactory, XMLSearchSourceFactory.
Configurable objects that are owned or contained by other configurable objects will be initialized
in by the parent object.
- Specified by:
initialize in interface IConfigurable