org.opennms.netmgt.vmmgr
Class DatabaseChecker

java.lang.Object
  extended by org.opennms.netmgt.vmmgr.DatabaseChecker

public class DatabaseChecker
extends Object

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

Author:
Brian Weaver , OpenNMS

Constructor Summary
protected DatabaseChecker()
          Load the config from the default config file and create the singleton instance of this factory.
protected DatabaseChecker(String configFile)
          Protected constructor
 
Method Summary
 void check()
           
static void main(String[] argv)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DatabaseChecker

protected DatabaseChecker(String configFile)
                   throws IOException,
                          org.exolab.castor.xml.MarshalException,
                          org.exolab.castor.xml.ValidationException,
                          ClassNotFoundException
Protected constructor

Throws:
IOException - Thrown if the specified config file cannot be read
org.exolab.castor.xml.MarshalException - Thrown if the file does not conform to the schema.
org.exolab.castor.xml.ValidationException - Thrown if the contents do not match the required schema.
ClassNotFoundException

DatabaseChecker

protected DatabaseChecker()
                   throws IOException,
                          org.exolab.castor.xml.MarshalException,
                          org.exolab.castor.xml.ValidationException,
                          ClassNotFoundException
Load the config from the default config file and create the singleton instance of this factory.

Throws:
IOException - Thrown if the specified config file cannot be read
org.exolab.castor.xml.MarshalException - Thrown if the file does not conform to the schema.
org.exolab.castor.xml.ValidationException - Thrown if the contents do not match the required schema.
ClassNotFoundException
Method Detail

check

public void check()
           throws SQLException
Throws:
SQLException

main

public static void main(String[] argv)
                 throws Exception
Throws:
Exception


Copyright © 2009. All Rights Reserved.