Skip to content

Commit

Permalink
Because the sql stats can sometimes be null, the types need to be pas…
Browse files Browse the repository at this point in the history
…sed into insertIncomingBatchHistory
  • Loading branch information
chenson42 committed Apr 14, 2008
1 parent ac00d40 commit fd3932d
Showing 1 changed file with 17 additions and 7 deletions.
Expand Up @@ -23,6 +23,7 @@

import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Types;
import java.util.List;

import org.apache.commons.logging.Log;
Expand Down Expand Up @@ -107,13 +108,22 @@ public int updateIncomingBatch(IncomingBatch status) {
}

public void insertIncomingBatchHistory(IncomingBatchHistory history) {
jdbcTemplate.update(insertIncomingBatchHistorySql, new Object[] { Long.valueOf(history.getBatchId()),
history.getNodeId(), history.getStatus().toString(), history.getNetworkMillis(),
history.getFilterMillis(), history.getDatabaseMillis(), history.getHostName(),
history.getByteCount(), history.getStatementCount(), history.getFallbackInsertCount(),
history.getFallbackUpdateCount(), history.getMissingDeleteCount(),
history.getFailedRowNumber(), history.getStartTime(), history.getEndTime(),
history.getSqlState(), history.getSqlCode(), history.getSqlMessage() });
try {
jdbcTemplate.update(insertIncomingBatchHistorySql, new Object[] {
Long.valueOf(history.getBatchId()), history.getNodeId(), history.getStatus().toString(),
history.getNetworkMillis(), history.getFilterMillis(), history.getDatabaseMillis(),
history.getHostName(), history.getByteCount(), history.getStatementCount(),
history.getFallbackInsertCount(), history.getFallbackUpdateCount(),
history.getMissingDeleteCount(), history.getFailedRowNumber(), history.getStartTime(),
history.getEndTime(), history.getSqlState(), history.getSqlCode(),
history.getSqlMessage() }, new int[] { Types.INTEGER, Types.VARCHAR, Types.CHAR,
Types.INTEGER, Types.INTEGER, Types.INTEGER, Types.VARCHAR, Types.INTEGER, Types.INTEGER,
Types.INTEGER, Types.INTEGER, Types.INTEGER, Types.INTEGER, Types.TIMESTAMP,
Types.TIMESTAMP, Types.VARCHAR, Types.INTEGER, Types.VARCHAR });
} catch (RuntimeException ex) {
logger.error(ex, ex);
throw ex;
}
}

class IncomingBatchMapper implements RowMapper {
Expand Down

0 comments on commit fd3932d

Please sign in to comment.