|
OpenNMS API 1.2.9 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opennms.netmgt.config.LegacyDbConnectionFactory
This is the singleton class used to load the OpenNMS database configuration from the opennms-database.xml. This provides convenience methods to create database connections to the database configured in this default xml
Note: Users of this class should make sure the init() is called before calling any other method to ensure the config is loaded before accessing other convenience methods
Nested Class Summary | |
(package private) static class |
LegacyDbConnectionFactory.CachedConnection
This class is used to represent a cached database connection within this factory. |
Field Summary | |
private java.util.LinkedList |
m_dbcCache
The linked list of cached connections that are reused if the garbage collector has not finalized them yet. |
private DbConfiguration |
m_dbConfig
Configuation of the database |
private static int |
MAX_AGE
The maximum age before a connection is closed |
Constructor Summary | |
LegacyDbConnectionFactory(DbConfiguration dbConfig)
|
Method Summary | |
java.sql.Connection |
getConnection()
Return a new database connection to the database configured in the opennms-database.xml. |
private java.lang.String |
getDriverPass()
|
private java.lang.String |
getDriverUrl()
|
private java.lang.String |
getDriverUser()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final int MAX_AGE
private DbConfiguration m_dbConfig
private java.util.LinkedList m_dbcCache
Constructor Detail |
public LegacyDbConnectionFactory(DbConfiguration dbConfig) throws java.lang.ClassNotFoundException
Method Detail |
public java.sql.Connection getConnection() throws java.sql.SQLException
close
method.
getConnection
in interface DbConnectionFactory
java.sql.SQLException
- Thrown if there is an error opening the connection to the
database.private java.lang.String getDriverUrl()
private java.lang.String getDriverUser()
private java.lang.String getDriverPass()
|
OpenNMS API 1.2.9 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |