Statement statement;
String SQLQuery = "SELECT LJLEVEL, LCODE, nvl(LSYSLOGEQUIV,LLEVEL) LSYSLOGEQUIV " +
"FROM TLOGLEVEL " +
"ORDER BY LLEVEL";
ResultSet rs = null;
Connection jdbc_conn = null;
if (formatOK == false)
{
logger.log(Level.FATAL, "Connection parameters are not OK");
}
else
{
try{
// connect to database
Class.forName("oracle.jdbc.driver.OracleDriver");
jdbc_conn = DriverManager.getConnection(JDBCurl, DbUser, DbPass);
logger.debug( "JDBC Connection OK: " + jdbc_conn.toString());
// get the PL/SQL and corresponding LOG4J log levels
statement = jdbc_conn.createStatement();
rs = statement.executeQuery(SQLQuery);
if (rs != null)
{
while(rs.next())
{
Level l = new DynamicLevel (rs.getInt("LJLEVEL"),rs.getString("LCODE"),rs.getInt("LSYSLOGEQUIV"));
Integer levelint = new Integer(rs.getInt("LSYSLOGEQUIV"));
htLevels.put(levelint, l);
}
}
// close the connection
jdbc_conn.close();
}
catch (SQLException SQLe) {
logger.fatal("SQL error : " + SQLe);
}
catch (Exception e) {