org.osesb.configuration
Class JDBCConfigurationLoader
java.lang.Object
org.osesb.configuration.JDBCConfigurationLoader
public class JDBCConfigurationLoader
- extends java.lang.Object
This Class is a helper for loading JDBCConfiguration(s).
First, a JDBCConfiguration can specify either a
<databaseConnection> or a <dataSource> content model.
Second, JDBCConfiguration(s) are typically embedded
within other configurations (see TableSetConfiguration).
Further, the jdbc-configuration can be explicitly embedded
or referenced as an external file by the configFile
and contentModelTagName attributes of a <jdbc-configuration>
content model.
- Since:
- Version .9
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JDBCConfigurationLoader
public JDBCConfigurationLoader()
loadJDBCConfiguration
public static JDBCConfiguration loadJDBCConfiguration(org.w3c.dom.Element jdbcContentModelElement)
throws java.lang.Exception
- Loads the JDBCConfiguration from a contentModel
Element.
Example JDBCConfiguration:
<jdbc-configuration>
<databaseConnection>
<!-- DB2 Type 4 Driver -->
<driverClass>com.ibm.db2.jcc.DB2Driver</driverClass>
<databaseURL>jdbc:db2://localhost:50000/SAMPLE</databaseURL>
<userName>db2admin</userName>
<password>db2admin</password>
<debugFlag>true</debugFlag>
<!-- dbPing interval in seconds. -->
<!-- Used in conjunction with the 'useConnectionManager' attribute of the 'databaseConnection' tag. -->
<!-- Used by a DriverConnectionManager to periodically test a connection. -->
<!-- Default is no dbPing. -->
<dbPingIntervalSeconds></dbPingIntervalSeconds>
</databaseConnection>
</jdbc-configuration>
Or
<jdbc-configuration
configFile="config/test/some-config-file.xml"
xpathExpression="//jdbc-configuration/databaseConnection">
</jdbc-configuration>
- Parameters:
jdbcContentModelElement - The Element that contains the
JDBCConfiguration.
- Returns:
- a JDBCConfiguration or null if a
ConfigurationConstants.JDBCCONFIG_CONTENTMODEL
is not present.
- Throws:
java.lang.Exception - if the JDBCConfiguration exists,
but could not be loaded due to an error.