use of com.linkedin.databus.bootstrap.common.BootstrapConn in project databus by linkedin.
the class BootstrapApplierThread method getConnection.
private Connection getConnection() throws SQLException {
Connection conn = null;
BootstrapConn bsConn = null;
if (_bootstrapDao == null) {
bsConn = new BootstrapConn();
try {
final boolean autoCommit = false;
bsConn.initBootstrapConn(autoCommit, java.sql.Connection.TRANSACTION_READ_COMMITTED, _config.getBootstrapDBUsername(), _config.getBootstrapDBPassword(), _config.getBootstrapDBHostname(), _config.getBootstrapDBName());
_bootstrapDao = new BootstrapDBMetaDataDAO(bsConn, _config.getBootstrapDBHostname(), _config.getBootstrapDBUsername(), _config.getBootstrapDBPassword(), _config.getBootstrapDBName(), autoCommit);
} catch (SQLException e) {
LOG.fatal("Unable to get Bootstrap DB Connection", e);
throw e;
} catch (Exception ex) {
LOG.fatal("Unable to get Bootstrap DB Connection", ex);
return null;
}
}
try {
conn = _bootstrapDao.getBootstrapConn().getDBConn();
} catch (SQLException sqlEx) {
LOG.fatal("NOT able to get Bootstrap DB Connection", sqlEx);
throw sqlEx;
}
return conn;
}
Aggregations