public Connection newConnection() { try { Class.forName(config.getJdbcDriverClass()); Connection conn = java.sql.DriverManager.getConnection( config.getDbUrl(), config.getDbUser(), config.getDbPassword()); return conn; } catch (Throwable e) { throw new LogEvaluatorException("creating Connection in ConnectionFactory", e); } }
public boolean testConnection() { try { Class.forName(config.getJdbcDriverClass()); Connection conn = java.sql.DriverManager.getConnection( config.getDbUrl(), config.getDbUser(), config.getDbPassword()); conn.close(); return true; } catch (Throwable e) { if (logger != null) { logger.println("connection not created"); logger.println(e.toString()); } return false; } }