EVENT_ID_COL_NAME = EVENT_ID_COL_NAME.toLowerCase(); insertStatement = connection.prepareStatement(getInsertSQL(), new String[] { EVENT_ID_COL_NAME }); } else { insertStatement = connection.prepareStatement(getInsertSQL()); subAppend(eventObject, connection, insertStatement); eventId = selectEventId(insertStatement, connection); secondarySubAppend(eventObject, connection, eventId); addError("problem appending event", sqle); } finally { DBHelper.closeStatement(insertStatement);
if (cnxSupportsGetGeneratedKeys) { try { rs = (ResultSet) getGeneratedKeysMethod().invoke(insertStatement, (Object[]) null); gotGeneratedKeys = true; addWarn( "IllegalAccessException invoking PreparedStatement.getGeneratedKeys", ex);
@Override public void start() { if (dbNameResolver == null) dbNameResolver = new DefaultDBNameResolver(); insertExceptionSQL = SQLBuilder.buildInsertExceptionSQL(dbNameResolver); insertPropertiesSQL = SQLBuilder.buildInsertPropertiesSQL(dbNameResolver); insertSQL = SQLBuilder.buildInsertSQL(dbNameResolver); super.start(); }
@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); } }
if (cnxSupportsGetGeneratedKeys) { try { rs = (ResultSet) getGeneratedKeysMethod().invoke(insertStatement, (Object[]) null); gotGeneratedKeys = true; addWarn( "IllegalAccessException invoking PreparedStatement.getGeneratedKeys", ex); close(idStatement);
@Override public void start() { if (connectionSource == null) { throw new IllegalStateException( "DBAppender cannot function without a connection source"); } sqlDialect = DBUtil .getDialectFromCode(connectionSource.getSQLDialectCode()); if (getGeneratedKeysMethod() != null) { cnxSupportsGetGeneratedKeys = connectionSource.supportsGetGeneratedKeys(); } else { cnxSupportsGetGeneratedKeys = false; } cnxSupportsBatchUpdates = connectionSource.supportsBatchUpdates(); if (!cnxSupportsGetGeneratedKeys && (sqlDialect == null)) { throw new IllegalStateException( "DBAppender cannot function if the JDBC driver does not support getGeneratedKeys method *and* without a specific SQL dialect"); } // all nice and dandy on the eastern front super.start(); }
if (cnxSupportsGetGeneratedKeys) { try { rs = (ResultSet) getGeneratedKeysMethod().invoke(insertStatement, (Object[]) null); gotGeneratedKeys = true; addWarn( "IllegalAccessException invoking PreparedStatement.getGeneratedKeys", ex); close(idStatement);
@Override public void start() { if (connectionSource == null) { throw new IllegalStateException( "DBAppender cannot function without a connection source"); } sqlDialect = DBUtil .getDialectFromCode(connectionSource.getSQLDialectCode()); if (getGeneratedKeysMethod() != null) { cnxSupportsGetGeneratedKeys = connectionSource.supportsGetGeneratedKeys(); } else { cnxSupportsGetGeneratedKeys = false; } cnxSupportsBatchUpdates = connectionSource.supportsBatchUpdates(); if (!cnxSupportsGetGeneratedKeys && (sqlDialect == null)) { throw new IllegalStateException( "DBAppender cannot function if the JDBC driver does not support getGeneratedKeys method *and* without a specific SQL dialect"); } // all nice and dandy on the eastern front super.start(); }
EVENT_ID_COL_NAME = EVENT_ID_COL_NAME.toLowerCase(); insertStatement = connection.prepareStatement(getInsertSQL(), new String[] { EVENT_ID_COL_NAME }); } else { insertStatement = connection.prepareStatement(getInsertSQL()); subAppend(eventObject, connection, insertStatement); eventId = selectEventId(insertStatement, connection); secondarySubAppend(eventObject, connection, eventId); close(insertStatement); addError("problem appending event", sqle); } finally { DBHelper.closeConnection(connection);
if (cnxSupportsGetGeneratedKeys) { try { rs = (ResultSet) getGeneratedKeysMethod().invoke(insertStatement, (Object[]) null); gotGeneratedKeys = true; addWarn( "IllegalAccessException invoking PreparedStatement.getGeneratedKeys", ex);
@Override public void start() { if (connectionSource == null) { throw new IllegalStateException("DBAppender cannot function without a connection source"); } sqlDialect = DBUtil.getDialectFromCode(connectionSource.getSQLDialectCode()); if (getGeneratedKeysMethod() != null) { cnxSupportsGetGeneratedKeys = connectionSource.supportsGetGeneratedKeys(); } else { cnxSupportsGetGeneratedKeys = false; } cnxSupportsBatchUpdates = connectionSource.supportsBatchUpdates(); if (!cnxSupportsGetGeneratedKeys && (sqlDialect == null)) { throw new IllegalStateException( "DBAppender cannot function if the JDBC driver does not support getGeneratedKeys method *and* without a specific SQL dialect"); } // all nice and dandy on the eastern front super.start(); }
@Override public void start() { if (dbNameResolver == null) dbNameResolver = new DefaultDBNameResolver(); insertExceptionSQL = SQLBuilder.buildInsertExceptionSQL(dbNameResolver); insertPropertiesSQL = SQLBuilder.buildInsertPropertiesSQL(dbNameResolver); insertSQL = SQLBuilder.buildInsertSQL(dbNameResolver); super.start(); }
EVENT_ID_COL_NAME = EVENT_ID_COL_NAME.toLowerCase(); insertStatement = connection.prepareStatement(getInsertSQL(), new String[] { EVENT_ID_COL_NAME }); } else { insertStatement = connection.prepareStatement(getInsertSQL()); subAppend(eventObject, connection, insertStatement); eventId = selectEventId(insertStatement, connection); secondarySubAppend(eventObject, connection, eventId); close(insertStatement); addError("problem appending event", sqle); } finally { DBHelper.closeConnection(connection);
if (cnxSupportsGetGeneratedKeys) { try { rs = (ResultSet) getGeneratedKeysMethod().invoke(insertStatement, (Object[]) null); gotGeneratedKeys = true; } catch (InvocationTargetException ex) { addWarn("IllegalAccessException invoking PreparedStatement.getGeneratedKeys", ex);
@Override public void start() { if (connectionSource == null) { throw new IllegalStateException("DBAppender cannot function without a connection source"); } sqlDialect = DBUtil.getDialectFromCode(connectionSource.getSQLDialectCode()); if (getGeneratedKeysMethod() != null) { cnxSupportsGetGeneratedKeys = connectionSource.supportsGetGeneratedKeys(); } else { cnxSupportsGetGeneratedKeys = false; } cnxSupportsBatchUpdates = connectionSource.supportsBatchUpdates(); if (!cnxSupportsGetGeneratedKeys && (sqlDialect == null)) { throw new IllegalStateException( "DBAppender cannot function if the JDBC driver does not support getGeneratedKeys method *and* without a specific SQL dialect"); } // all nice and dandy on the eastern front super.start(); }
@Override public void start() { if (dbNameResolver == null) dbNameResolver = new DefaultDBNameResolver(); insertExceptionSQL = SQLBuilder.buildInsertExceptionSQL(dbNameResolver); insertPropertiesSQL = SQLBuilder.buildInsertPropertiesSQL(dbNameResolver); insertSQL = SQLBuilder.buildInsertSQL(dbNameResolver); super.start(); }
EVENT_ID_COL_NAME = EVENT_ID_COL_NAME.toLowerCase(); insertStatement = connection.prepareStatement(getInsertSQL(), new String[] { EVENT_ID_COL_NAME }); } else { insertStatement = connection.prepareStatement(getInsertSQL()); subAppend(eventObject, connection, insertStatement); eventId = selectEventId(insertStatement, connection); secondarySubAppend(eventObject, connection, eventId); addError("problem appending event", sqle); } finally { DBHelper.closeStatement(insertStatement);
if (cnxSupportsGetGeneratedKeys) { try { rs = (ResultSet) getGeneratedKeysMethod().invoke(insertStatement, (Object[]) null); gotGeneratedKeys = true; } catch (InvocationTargetException ex) { addWarn("IllegalAccessException invoking PreparedStatement.getGeneratedKeys", ex);
@Override public void start() { if (connectionSource == null) { throw new IllegalStateException("DBAppender cannot function without a connection source"); } sqlDialect = DBUtil.getDialectFromCode(connectionSource.getSQLDialectCode()); if (getGeneratedKeysMethod() != null) { cnxSupportsGetGeneratedKeys = connectionSource.supportsGetGeneratedKeys(); } else { cnxSupportsGetGeneratedKeys = false; } cnxSupportsBatchUpdates = connectionSource.supportsBatchUpdates(); if (!cnxSupportsGetGeneratedKeys && (sqlDialect == null)) { throw new IllegalStateException( "DBAppender cannot function if the JDBC driver does not support getGeneratedKeys method *and* without a specific SQL dialect"); } // all nice and dandy on the eastern front super.start(); }
@Override public void start() { if (dbNameResolver == null) dbNameResolver = new DefaultDBNameResolver(); insertExceptionSQL = SQLBuilder.buildInsertExceptionSQL(dbNameResolver); insertPropertiesSQL = SQLBuilder.buildInsertPropertiesSQL(dbNameResolver); insertSQL = SQLBuilder.buildInsertSQL(dbNameResolver); super.start(); }