} finally { DBHelper.closeStatement(insertStatement); DBHelper.closeConnection(connection);
/** * Learn relevant information about this connection source. * */ public void discoverConnectionProperties() { Connection connection = null; try { connection = getConnection(); if (connection == null) { addWarn("Could not get a connection"); return; } DatabaseMetaData meta = connection.getMetaData(); DBUtil util = new DBUtil(); util.setContext(getContext()); supportsGetGeneratedKeys = util.supportsGetGeneratedKeys(meta); supportsBatchUpdates = util.supportsBatchUpdates(meta); dialectCode = DBUtil.discoverSQLDialect(meta); addInfo("Driver name="+meta.getDriverName()); addInfo("Driver version="+meta.getDriverVersion()); addInfo("supportsGetGeneratedKeys="+supportsGetGeneratedKeys); } catch (SQLException se) { addWarn("Could not discover the dialect to use.", se); } finally { DBHelper.closeConnection(connection); } }
@Override public void append(E eventObject) { Connection connection = null; try { connection = connectionSource.getConnection(); connection.setAutoCommit(false); PreparedStatement insertStatement; if (cnxSupportsGetGeneratedKeys) { insertStatement = connection.prepareStatement(getInsertSQL(), new String[] {"EVENT_ID"}); } else { insertStatement = connection.prepareStatement(getInsertSQL()); } subAppend(eventObject, connection, insertStatement); // we no longer need the insertStatement if (insertStatement != null) { insertStatement.close(); insertStatement = null; } connection.commit(); } catch (Throwable sqle) { addError("problem appending event", sqle); } finally { DBHelper.closeConnection(connection); } }
} finally { DBHelper.closeStatement(insertStatement); DBHelper.closeConnection(connection);
} finally { DBHelper.closeStatement(insertStatement); DBHelper.closeConnection(connection);
addError("problem appending event", sqle); } finally { DBHelper.closeConnection(connection);
addError("problem appending event", sqle); } finally { DBHelper.closeConnection(connection);
} finally { DBHelper.closeStatement(insertStatement); DBHelper.closeConnection(connection);
} finally { DBHelper.closeStatement(insertStatement); DBHelper.closeConnection(connection);
/** * Learn relevant information about this connection source. * */ public void discoverConnectionProperties() { Connection connection = null; try { connection = getConnection(); if (connection == null) { addWarn("Could not get a connection"); return; } DatabaseMetaData meta = connection.getMetaData(); DBUtil util = new DBUtil(); util.setContext(getContext()); supportsGetGeneratedKeys = util.supportsGetGeneratedKeys(meta); supportsBatchUpdates = util.supportsBatchUpdates(meta); dialectCode = DBUtil.discoverSQLDialect(meta); addInfo("Driver name=" + meta.getDriverName()); addInfo("Driver version=" + meta.getDriverVersion()); addInfo("supportsGetGeneratedKeys=" + supportsGetGeneratedKeys); } catch (SQLException se) { addWarn("Could not discover the dialect to use.", se); } finally { DBHelper.closeConnection(connection); } }
/** * Learn relevant information about this connection source. * */ public void discoverConnectionProperties() { Connection connection = null; try { connection = getConnection(); if (connection == null) { addWarn("Could not get a connection"); return; } DatabaseMetaData meta = connection.getMetaData(); DBUtil util = new DBUtil(); util.setContext(getContext()); supportsGetGeneratedKeys = util.supportsGetGeneratedKeys(meta); supportsBatchUpdates = util.supportsBatchUpdates(meta); dialectCode = DBUtil.discoverSQLDialect(meta); addInfo("Driver name=" + meta.getDriverName()); addInfo("Driver version=" + meta.getDriverVersion()); addInfo("supportsGetGeneratedKeys=" + supportsGetGeneratedKeys); } catch (SQLException se) { addWarn("Could not discover the dialect to use.", se); } finally { DBHelper.closeConnection(connection); } }
/** * Learn relevant information about this connection source. * */ public void discoverConnectionProperties() { Connection connection = null; try { connection = getConnection(); if (connection == null) { addWarn("Could not get a connection"); return; } DatabaseMetaData meta = connection.getMetaData(); DBUtil util = new DBUtil(); util.setContext(getContext()); supportsGetGeneratedKeys = util.supportsGetGeneratedKeys(meta); supportsBatchUpdates = util.supportsBatchUpdates(meta); dialectCode = DBUtil.discoverSQLDialect(meta); addInfo("Driver name=" + meta.getDriverName()); addInfo("Driver version=" + meta.getDriverVersion()); addInfo("supportsGetGeneratedKeys=" + supportsGetGeneratedKeys); } catch (SQLException se) { addWarn("Could not discover the dialect to use.", se); } finally { DBHelper.closeConnection(connection); } }
/** * Learn relevant information about this connection source. * */ public void discoverConnectionProperties() { Connection connection = null; try { connection = getConnection(); if (connection == null) { addWarn("Could not get a connection"); return; } DatabaseMetaData meta = connection.getMetaData(); DBUtil util = new DBUtil(); util.setContext(getContext()); supportsGetGeneratedKeys = util.supportsGetGeneratedKeys(meta); supportsBatchUpdates = util.supportsBatchUpdates(meta); dialectCode = DBUtil.discoverSQLDialect(meta); addInfo("Driver name="+meta.getDriverName()); addInfo("Driver version="+meta.getDriverVersion()); addInfo("supportsGetGeneratedKeys="+supportsGetGeneratedKeys); } catch (SQLException se) { addWarn("Could not discover the dialect to use.", se); } finally { DBHelper.closeConnection(connection); } }