/** * <p> * Replace the table prefix in a query by replacing any occurrences of * "{0}" with the table prefix. * </p> * * @param query * the unsubstitued query * @return the query, with proper table prefix substituted */ protected final String rtp(String query) { return Util.rtp(query, tablePrefix, getSchedulerNameLiteral()); }
/** * <p> * Replace the table prefix in a query by replacing any occurrences of * "{0}" with the table prefix. * </p> * * @param query * the unsubstitued query * @return the query, with proper table prefix substituted */ protected final String rtp(String query) { return Util.rtp(query, tablePrefix, getSchedulerNameLiteral()); }
public int deleteExtendedTriggerProperties(Connection conn, TriggerKey triggerKey) throws SQLException { PreparedStatement ps = null; try { ps = conn.prepareStatement(Util.rtp(DELETE_CRON_TRIGGER, tablePrefix, schedNameLiteral)); ps.setString(1, triggerKey.getName()); ps.setString(2, triggerKey.getGroup()); return ps.executeUpdate(); } finally { Util.closeStatement(ps); } }
public int deleteExtendedTriggerProperties(Connection conn, TriggerKey triggerKey) throws SQLException { PreparedStatement ps = null; try { ps = conn.prepareStatement(Util.rtp(DELETE_SIMPLE_PROPS_TRIGGER, tablePrefix, schedNameLiteral)); ps.setString(1, triggerKey.getName()); ps.setString(2, triggerKey.getGroup()); return ps.executeUpdate(); } finally { Util.closeStatement(ps); } }
public int deleteExtendedTriggerProperties(Connection conn, TriggerKey triggerKey) throws SQLException { PreparedStatement ps = null; try { ps = conn.prepareStatement(Util.rtp(DELETE_CRON_TRIGGER, tablePrefix, schedNameLiteral)); ps.setString(1, triggerKey.getName()); ps.setString(2, triggerKey.getGroup()); return ps.executeUpdate(); } finally { Util.closeStatement(ps); } }
private void lockViaInsert(Connection conn, String lockName, String sql) throws SQLException { getLog().debug("Inserting new lock row for lock: '" + lockName + "' being obtained by thread: " + Thread.currentThread().getName()); PreparedStatement ps = conn.prepareStatement(sql); try { ps.setString(1, lockName); if(ps.executeUpdate() != 1) { throw new SQLException(Util.rtp( "No row exists, and one could not be inserted in table " + TABLE_PREFIX_SUBST + TABLE_LOCKS + " for lock named: " + lockName, getTablePrefix(), getSchedulerNameLiteral())); } } finally { ps.close(); } } }
public int deleteExtendedTriggerProperties(Connection conn, TriggerKey triggerKey) throws SQLException { PreparedStatement ps = null; try { ps = conn.prepareStatement(Util.rtp(DELETE_SIMPLE_TRIGGER, tablePrefix, schedNameLiteral)); ps.setString(1, triggerKey.getName()); ps.setString(2, triggerKey.getGroup()); return ps.executeUpdate(); } finally { Util.closeStatement(ps); } }
private void lockViaInsert(Connection conn, String lockName, String sql) throws SQLException { getLog().debug("Inserting new lock row for lock: '" + lockName + "' being obtained by thread: " + Thread.currentThread().getName()); PreparedStatement ps = conn.prepareStatement(sql); try { ps.setString(1, lockName); if(ps.executeUpdate() != 1) { throw new SQLException(Util.rtp( "No row exists, and one could not be inserted in table " + TABLE_PREFIX_SUBST + TABLE_LOCKS + " for lock named: " + lockName, getTablePrefix(), getSchedulerNameLiteral())); } } finally { ps.close(); } } }
public int deleteExtendedTriggerProperties(Connection conn, TriggerKey triggerKey) throws SQLException { PreparedStatement ps = null; try { ps = conn.prepareStatement(Util.rtp(DELETE_SIMPLE_PROPS_TRIGGER, tablePrefix, schedNameLiteral)); ps.setString(1, triggerKey.getName()); ps.setString(2, triggerKey.getGroup()); return ps.executeUpdate(); } finally { Util.closeStatement(ps); } }
public int deleteExtendedTriggerProperties(Connection conn, TriggerKey triggerKey) throws SQLException { PreparedStatement ps = null; try { ps = conn.prepareStatement(Util.rtp(DELETE_SIMPLE_TRIGGER, tablePrefix, schedNameLiteral)); ps.setString(1, triggerKey.getName()); ps.setString(2, triggerKey.getGroup()); return ps.executeUpdate(); } finally { Util.closeStatement(ps); } }
public int updateExtendedTriggerProperties(Connection conn, OperableTrigger trigger, String state, JobDetail jobDetail) throws SQLException, IOException { SimpleTrigger simpleTrigger = (SimpleTrigger)trigger; PreparedStatement ps = null; try { ps = conn.prepareStatement(Util.rtp(UPDATE_SIMPLE_TRIGGER, tablePrefix, schedNameLiteral)); ps.setInt(1, simpleTrigger.getRepeatCount()); ps.setBigDecimal(2, new BigDecimal(String.valueOf(simpleTrigger.getRepeatInterval()))); ps.setInt(3, simpleTrigger.getTimesTriggered()); ps.setString(4, simpleTrigger.getKey().getName()); ps.setString(5, simpleTrigger.getKey().getGroup()); return ps.executeUpdate(); } finally { Util.closeStatement(ps); } }
public int updateExtendedTriggerProperties(Connection conn, OperableTrigger trigger, String state, JobDetail jobDetail) throws SQLException, IOException { CronTrigger cronTrigger = (CronTrigger)trigger; PreparedStatement ps = null; try { ps = conn.prepareStatement(Util.rtp(UPDATE_CRON_TRIGGER, tablePrefix, schedNameLiteral)); ps.setString(1, cronTrigger.getCronExpression()); ps.setString(2, cronTrigger.getTimeZone().getID()); ps.setString(3, trigger.getKey().getName()); ps.setString(4, trigger.getKey().getGroup()); return ps.executeUpdate(); } finally { Util.closeStatement(ps); } }
public int insertExtendedTriggerProperties(Connection conn, OperableTrigger trigger, String state, JobDetail jobDetail) throws SQLException, IOException { CronTrigger cronTrigger = (CronTrigger)trigger; PreparedStatement ps = null; try { ps = conn.prepareStatement(Util.rtp(INSERT_CRON_TRIGGER, tablePrefix, schedNameLiteral)); ps.setString(1, trigger.getKey().getName()); ps.setString(2, trigger.getKey().getGroup()); ps.setString(3, cronTrigger.getCronExpression()); ps.setString(4, cronTrigger.getTimeZone().getID()); return ps.executeUpdate(); } finally { Util.closeStatement(ps); } }
public int updateExtendedTriggerProperties(Connection conn, OperableTrigger trigger, String state, JobDetail jobDetail) throws SQLException, IOException { CronTrigger cronTrigger = (CronTrigger)trigger; PreparedStatement ps = null; try { ps = conn.prepareStatement(Util.rtp(UPDATE_CRON_TRIGGER, tablePrefix, schedNameLiteral)); ps.setString(1, cronTrigger.getCronExpression()); ps.setString(2, cronTrigger.getTimeZone().getID()); ps.setString(3, trigger.getKey().getName()); ps.setString(4, trigger.getKey().getGroup()); return ps.executeUpdate(); } finally { Util.closeStatement(ps); } }
public int insertExtendedTriggerProperties(Connection conn, OperableTrigger trigger, String state, JobDetail jobDetail) throws SQLException, IOException { CronTrigger cronTrigger = (CronTrigger)trigger; PreparedStatement ps = null; try { ps = conn.prepareStatement(Util.rtp(INSERT_CRON_TRIGGER, tablePrefix, schedNameLiteral)); ps.setString(1, trigger.getKey().getName()); ps.setString(2, trigger.getKey().getGroup()); ps.setString(3, cronTrigger.getCronExpression()); ps.setString(4, cronTrigger.getTimeZone().getID()); return ps.executeUpdate(); } finally { Util.closeStatement(ps); } }
public int insertExtendedTriggerProperties(Connection conn, OperableTrigger trigger, String state, JobDetail jobDetail) throws SQLException, IOException { SimpleTrigger simpleTrigger = (SimpleTrigger)trigger; PreparedStatement ps = null; try { ps = conn.prepareStatement(Util.rtp(INSERT_SIMPLE_TRIGGER, tablePrefix, schedNameLiteral)); ps.setString(1, trigger.getKey().getName()); ps.setString(2, trigger.getKey().getGroup()); ps.setInt(3, simpleTrigger.getRepeatCount()); ps.setBigDecimal(4, new BigDecimal(String.valueOf(simpleTrigger.getRepeatInterval()))); ps.setInt(5, simpleTrigger.getTimesTriggered()); return ps.executeUpdate(); } finally { Util.closeStatement(ps); } }
public int updateExtendedTriggerProperties(Connection conn, OperableTrigger trigger, String state, JobDetail jobDetail) throws SQLException, IOException { SimpleTrigger simpleTrigger = (SimpleTrigger)trigger; PreparedStatement ps = null; try { ps = conn.prepareStatement(Util.rtp(UPDATE_SIMPLE_TRIGGER, tablePrefix, schedNameLiteral)); ps.setInt(1, simpleTrigger.getRepeatCount()); ps.setBigDecimal(2, new BigDecimal(String.valueOf(simpleTrigger.getRepeatInterval()))); ps.setInt(3, simpleTrigger.getTimesTriggered()); ps.setString(4, simpleTrigger.getKey().getName()); ps.setString(5, simpleTrigger.getKey().getGroup()); return ps.executeUpdate(); } finally { Util.closeStatement(ps); } }
public int insertExtendedTriggerProperties(Connection conn, OperableTrigger trigger, String state, JobDetail jobDetail) throws SQLException, IOException { SimpleTrigger simpleTrigger = (SimpleTrigger)trigger; PreparedStatement ps = null; try { ps = conn.prepareStatement(Util.rtp(INSERT_SIMPLE_TRIGGER, tablePrefix, schedNameLiteral)); ps.setString(1, trigger.getKey().getName()); ps.setString(2, trigger.getKey().getGroup()); ps.setInt(3, simpleTrigger.getRepeatCount()); ps.setBigDecimal(4, new BigDecimal(String.valueOf(simpleTrigger.getRepeatInterval()))); ps.setInt(5, simpleTrigger.getTimesTriggered()); return ps.executeUpdate(); } finally { Util.closeStatement(ps); } }