use of com.ibm.jbatch.container.services.IJobExecution in project Payara by payara.
the class JBatchJDBCPersistenceManager method jobOperatorGetJobExecution.
@Override
public IJobExecution jobOperatorGetJobExecution(long jobExecutionId) {
Connection conn = null;
PreparedStatement statement = null;
ResultSet rs = null;
IJobExecution jobEx = null;
ObjectInputStream objectIn = null;
try {
conn = getConnection();
statement = conn.prepareStatement(queryStrings.get(JOB_OPERATOR_GET_JOB_EXECUTION));
statement.setLong(1, jobExecutionId);
rs = statement.executeQuery();
jobEx = (rs.next()) ? readJobExecutionRecord(rs) : null;
} catch (SQLException e) {
throw new PersistenceException(e);
} catch (IOException e) {
throw new PersistenceException(e);
} catch (ClassNotFoundException e) {
throw new PersistenceException(e);
} finally {
if (objectIn != null) {
try {
objectIn.close();
} catch (IOException e) {
throw new PersistenceException(e);
}
}
cleanupConnection(conn, rs, statement);
}
return jobEx;
}
use of com.ibm.jbatch.container.services.IJobExecution in project Payara by payara.
the class JBatchJDBCPersistenceManager method jobOperatorGetJobExecutions.
@Override
public List<IJobExecution> jobOperatorGetJobExecutions(long jobInstanceId) {
Connection conn = null;
PreparedStatement statement = null;
ResultSet rs = null;
List<IJobExecution> data = new ArrayList<IJobExecution>();
ObjectInputStream objectIn = null;
try {
conn = getConnection();
statement = conn.prepareStatement(queryStrings.get(JOB_OPERATOR_GET_JOB_EXECUTIONS));
statement.setLong(1, jobInstanceId);
rs = statement.executeQuery();
while (rs.next()) {
data.add(readJobExecutionRecord(rs));
}
} catch (SQLException e) {
throw new PersistenceException(e);
} catch (IOException e) {
throw new PersistenceException(e);
} catch (ClassNotFoundException e) {
throw new PersistenceException(e);
} finally {
if (objectIn != null) {
try {
objectIn.close();
} catch (IOException e) {
throw new PersistenceException(e);
}
}
cleanupConnection(conn, rs, statement);
}
return data;
}
Aggregations