use of com.dangdang.ddframe.job.event.type.JobExecutionEventThrowable in project elastic-job by dangdangdotcom.
the class JobEventRdbSearch method getJobExecutionEvents.
private List<JobExecutionEvent> getJobExecutionEvents(final Condition condition) {
List<JobExecutionEvent> result = new LinkedList<>();
try (Connection conn = dataSource.getConnection();
PreparedStatement preparedStatement = createDataPreparedStatement(conn, TABLE_JOB_EXECUTION_LOG, FIELDS_JOB_EXECUTION_LOG, condition);
ResultSet resultSet = preparedStatement.executeQuery()) {
while (resultSet.next()) {
JobExecutionEvent jobExecutionEvent = new JobExecutionEvent(resultSet.getString(1), resultSet.getString(2), resultSet.getString(3), resultSet.getString(4), resultSet.getString(5), JobExecutionEvent.ExecutionSource.valueOf(resultSet.getString(6)), Integer.valueOf(resultSet.getString(7)), new Date(resultSet.getTimestamp(8).getTime()), resultSet.getTimestamp(9) == null ? null : new Date(resultSet.getTimestamp(9).getTime()), resultSet.getBoolean(10), new JobExecutionEventThrowable(null, resultSet.getString(11)));
result.add(jobExecutionEvent);
}
} catch (final SQLException ex) {
// TODO 记录失败直接输出日志,未来可考虑配置化
log.error("Fetch JobExecutionEvent from DB error:", ex);
}
return result;
}
Aggregations