prevFireTime = trigger.getPreviousFireTime().getTime();
}
ps.setBigDecimal(5, new BigDecimal(String.valueOf(prevFireTime)));
ps.setString(6, state);
TriggerPersistenceDelegate tDel = findTriggerPersistenceDelegate(trigger);
String type = TTYPE_BLOB;
if(tDel != null)
type = tDel.getHandledTriggerTypeDiscriminator();
ps.setString(7, type);
ps.setBigDecimal(8, new BigDecimal(String.valueOf(trigger
.getStartTime().getTime())));
long endTime = 0;
if (trigger.getEndTime() != null) {
endTime = trigger.getEndTime().getTime();
}
ps.setBigDecimal(9, new BigDecimal(String.valueOf(endTime)));
ps.setString(10, trigger.getCalendarName());
ps.setInt(11, trigger.getMisfireInstruction());
ps.setInt(12, trigger.getPriority());
ps.setString(13, trigger.getKey().getName());
ps.setString(14, trigger.getKey().getGroup());
insertResult = ps.executeUpdate();
if(updateJobData) {
ps.close();
ps = conn
.prepareStatement(rtp(UPDATE_ORACLE_TRIGGER_JOB_DETAIL_EMPTY_BLOB));
ps.setString(1, trigger.getKey().getName());
ps.setString(2, trigger.getKey().getGroup());
ps.executeUpdate();
ps.close();
ps = conn.prepareStatement(rtp(SELECT_ORACLE_TRIGGER_JOB_DETAIL_BLOB));
ps.setString(1, trigger.getKey().getName());
ps.setString(2, trigger.getKey().getGroup());
rs = ps.executeQuery();
if (rs.next()) {
//Blob dbBlob = writeDataToBlob(rs, 1, data);
ps2 = conn.prepareStatement(rtp(UPDATE_ORACLE_TRIGGER_JOB_DETAIL_BLOB));
ps2.setObject(1, data);
ps2.setString(2, trigger.getKey().getName());
ps2.setString(3, trigger.getKey().getGroup());
ps2.executeUpdate();
}
}
if(tDel == null)
updateBlobTrigger(conn, trigger);
else
tDel.updateExtendedTriggerProperties(conn, trigger, state, jobDetail);
} finally {
closeResultSet(rs);
closeStatement(ps);
closeStatement(ps2);