protected static JdbcConnectionBroker getDbConnection(String propertyFileName) throws ApplicationException { final String dbUrl = JobProperties.getDbUrlParam(propertyFileName); final String userName = JobProperties.getUserName(propertyFileName); final String userPassword = JobProperties.getPassword(propertyFileName); AbstractLogger logger = AbstractLogger.getInstance(); logger.logInfo("Database = " + dbUrl); logger.logInfo("UserID = " + userName); // logger.logInfo("UserPassword = " + userPassword); JdbcConnectionBroker jdbcConnectionBroker = new JdbcConnectionBroker(); try { jdbcConnectionBroker.connect(dbUrl, userName, userPassword); } catch (SQLException ex) { logger.logError(ex); throw new ApplicationException(ex); } return jdbcConnectionBroker; }
protected static JdbcConnectionBroker init(String dbUrl, String userName, String password) throws SQLException { JdbcConnectionBroker jdbcConnectionBroker = new JdbcConnectionBroker(); jdbcConnectionBroker.connect(dbUrl, userName, password); return jdbcConnectionBroker; }