亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? stdjdbcdelegate.java

?? Java中非常實用流控制工具
?? JAVA
?? 第 1 頁 / 共 5 頁
字號:
/* 
 * Copyright 2004-2005 OpenSymphony 
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not 
 * use this file except in compliance with the License. You may obtain a copy 
 * of the License at 
 * 
 *   http://www.apache.org/licenses/LICENSE-2.0 
 *   
 * Unless required by applicable law or agreed to in writing, software 
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 
 * License for the specific language governing permissions and limitations 
 * under the License.
 * 
 */

/*
 * Previously Copyright (c) 2001-2004 James House
 */
package org.quartz.impl.jdbcjobstore;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.NotSerializableException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.math.BigDecimal;
import java.sql.Blob;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
import java.util.TimeZone;

import org.apache.commons.logging.Log;
import org.quartz.Calendar;
import org.quartz.CronTrigger;
import org.quartz.JobDataMap;
import org.quartz.JobDetail;
import org.quartz.Scheduler;
import org.quartz.SimpleTrigger;
import org.quartz.Trigger;
import org.quartz.spi.ClassLoadHelper;
import org.quartz.utils.Key;
import org.quartz.utils.TriggerStatus;

/**
 * <p>
 * This is meant to be an abstract base class for most, if not all, <code>{@link org.quartz.impl.jdbcjobstore.DriverDelegate}</code>
 * implementations. Subclasses should override only those methods that need
 * special handling for the DBMS driver in question.
 * </p>
 * 
 * @author <a href="mailto:jeff@binaryfeed.org">Jeffrey Wescott</a>
 * @author James House
 * @author Eric Mueller
 */
public class StdJDBCDelegate implements DriverDelegate, StdJDBCConstants {

    /*
     * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     * 
     * Data members.
     * 
     * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     */

    protected Log logger = null;

    protected String tablePrefix = DEFAULT_TABLE_PREFIX;

    protected String instanceId;

    protected boolean useProperties;

    /*
     * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     * 
     * Constructors.
     * 
     * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     */

    /**
     * <p>
     * Create new StdJDBCDelegate instance.
     * </p>
     * 
     * @param logger
     *          the logger to use during execution
     * @param tablePrefix
     *          the prefix of all table names
     */
    public StdJDBCDelegate(Log logger, String tablePrefix, String instanceId) {
        this.logger = logger;
        this.tablePrefix = tablePrefix;
        this.instanceId = instanceId;
    }

    /**
     * <p>
     * Create new StdJDBCDelegate instance.
     * </p>
     * 
     * @param logger
     *          the logger to use during execution
     * @param tablePrefix
     *          the prefix of all table names
     */
    public StdJDBCDelegate(Log logger, String tablePrefix, String instanceId,
            Boolean useProperties) {
        this.logger = logger;
        this.tablePrefix = tablePrefix;
        this.instanceId = instanceId;
        this.useProperties = useProperties.booleanValue();
    }

    /*
     * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     * 
     * Interface.
     * 
     * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     */

    protected boolean canUseProperties() {
        return useProperties;
    }

    //---------------------------------------------------------------------------
    // startup / recovery
    //---------------------------------------------------------------------------

    /**
     * <p>
     * Insert the job detail record.
     * </p>
     * 
     * @param conn
     *          the DB Connection
     * @param newState
     *          the new state for the triggers
     * @param oldState1
     *          the first old state to update
     * @param oldState2
     *          the second old state to update
     * @return number of rows updated
     */
    public int updateTriggerStatesFromOtherStates(Connection conn,
            String newState, String oldState1, String oldState2)
        throws SQLException {
        PreparedStatement ps = null;

        try {
            ps = conn
                    .prepareStatement(rtp(UPDATE_TRIGGER_STATES_FROM_OTHER_STATES));
            ps.setString(1, newState);
            ps.setString(2, oldState1);
            ps.setString(3, oldState2);
            return ps.executeUpdate();
        } finally {
            closeStatement(ps);
        }
    }

    /**
     * <p>
     * Get the names of all of the triggers that have misfired.
     * </p>
     * 
     * @param conn
     *          the DB Connection
     * @return an array of <code>{@link
     * org.quartz.utils.Key}</code> objects
     */
    public Key[] selectMisfiredTriggers(Connection conn, long ts)
        throws SQLException {
        PreparedStatement ps = null;
        ResultSet rs = null;

        try {
            ps = conn.prepareStatement(rtp(SELECT_MISFIRED_TRIGGERS));
            ps.setBigDecimal(1, new BigDecimal(String.valueOf(ts)));
            rs = ps.executeQuery();

            ArrayList list = new ArrayList();
            while (rs.next()) {
                String triggerName = rs.getString(COL_TRIGGER_NAME);
                String groupName = rs.getString(COL_TRIGGER_GROUP);
                list.add(new Key(triggerName, groupName));
            }
            Object[] oArr = list.toArray();
            Key[] kArr = new Key[oArr.length];
            System.arraycopy(oArr, 0, kArr, 0, oArr.length);
            return kArr;
        } finally {
            closeResultSet(rs);
            closeStatement(ps);
        }
    }

    /**
     * <p>
     * Select all of the triggers in a given state.
     * </p>
     * 
     * @param conn
     *          the DB Connection
     * @param state
     *          the state the triggers must be in
     * @return an array of trigger <code>Key</code> s
     */
    public Key[] selectTriggersInState(Connection conn, String state)
        throws SQLException {
        PreparedStatement ps = null;
        ResultSet rs = null;

        try {
            ps = conn.prepareStatement(rtp(SELECT_TRIGGERS_IN_STATE));
            ps.setString(1, state);
            rs = ps.executeQuery();

            ArrayList list = new ArrayList();
            while (rs.next()) {
                list.add(new Key(rs.getString(1), rs.getString(2)));
            }

            Key[] sArr = (Key[]) list.toArray(new Key[list.size()]);
            return sArr;
        } finally {
            closeResultSet(rs);
            closeStatement(ps);
        }
    }

    public Key[] selectMisfiredTriggersInState(Connection conn, String state,
            long ts) throws SQLException {
        PreparedStatement ps = null;
        ResultSet rs = null;

        try {
            ps = conn.prepareStatement(rtp(SELECT_MISFIRED_TRIGGERS_IN_STATE));
            ps.setBigDecimal(1, new BigDecimal(String.valueOf(ts)));
            ps.setString(2, state);
            rs = ps.executeQuery();

            ArrayList list = new ArrayList();
            while (rs.next()) {
                String triggerName = rs.getString(COL_TRIGGER_NAME);
                String groupName = rs.getString(COL_TRIGGER_GROUP);
                list.add(new Key(triggerName, groupName));
            }
            Object[] oArr = list.toArray();
            Key[] kArr = new Key[oArr.length];
            System.arraycopy(oArr, 0, kArr, 0, oArr.length);
            return kArr;
        } finally {
            closeResultSet(rs);
            closeStatement(ps);
        }
    }

    /**
     * <p>
     * Get the names of all of the triggers in the given states that have
     * misfired - according to the given timestamp.  No more than count will
     * be returned.
     * </p>
     * 
     * @param conn The DB Connection
     * @param count The most misfired triggers to return, negative for all
     * @param resultList Output parameter.  A List of 
     *      <code>{@link org.quartz.utils.Key}</code> objects.  Must not be null.
     *          
     * @return Whether there are more misfired triggers left to find beyond
     *         the given count.
     */
    public boolean selectMisfiredTriggersInStates(Connection conn, String state1, String state2,
        long ts, int count, List resultList) throws SQLException {
        PreparedStatement ps = null;
        ResultSet rs = null;

        try {
            ps = conn.prepareStatement(rtp(SELECT_MISFIRED_TRIGGERS_IN_STATES));
            ps.setBigDecimal(1, new BigDecimal(String.valueOf(ts)));
            ps.setString(2, state1);
            ps.setString(3, state2);
            rs = ps.executeQuery();

            boolean hasReachedLimit = false;
            while (rs.next() && (hasReachedLimit == false)) {
                if (resultList.size() == count) {
                    hasReachedLimit = true;
                } else {
                    String triggerName = rs.getString(COL_TRIGGER_NAME);
                    String groupName = rs.getString(COL_TRIGGER_GROUP);
                    resultList.add(new Key(triggerName, groupName));
                }
            }
            
            return hasReachedLimit;
        } finally {
            closeResultSet(rs);
            closeStatement(ps);
        }
    }
    
    /**
     * <p>
     * Get the number of triggers in the given states that have
     * misfired - according to the given timestamp.
     * </p>
     * 
     * @param conn the DB Connection
     */
    public int countMisfiredTriggersInStates(
            Connection conn, String state1, String state2, long ts) throws SQLException {
        PreparedStatement ps = null;
        ResultSet rs = null;

        try {
            ps = conn.prepareStatement(rtp(COUNT_MISFIRED_TRIGGERS_IN_STATES));
            ps.setBigDecimal(1, new BigDecimal(String.valueOf(ts)));
            ps.setString(2, state1);
            ps.setString(3, state2);
            rs = ps.executeQuery();

            if (rs.next()) {
                return rs.getInt(1);
            }

            throw new SQLException("No misfired trigger count returned.");
        } finally {
            closeResultSet(rs);
            closeStatement(ps);
        }
    }

    /**
     * <p>
     * Get the names of all of the triggers in the given group and state that
     * have misfired.
     * </p>
     * 
     * @param conn
     *          the DB Connection
     * @return an array of <code>{@link
     * org.quartz.utils.Key}</code> objects
     */
    public Key[] selectMisfiredTriggersInGroupInState(Connection conn,
            String groupName, String state, long ts) throws SQLException {
        PreparedStatement ps = null;
        ResultSet rs = null;

        try {
            ps = conn
                    .prepareStatement(rtp(SELECT_MISFIRED_TRIGGERS_IN_GROUP_IN_STATE));
            ps.setBigDecimal(1, new BigDecimal(String.valueOf(ts)));
            ps.setString(2, groupName);
            ps.setString(3, state);
            rs = ps.executeQuery();

            ArrayList list = new ArrayList();
            while (rs.next()) {
                String triggerName = rs.getString(COL_TRIGGER_NAME);
                list.add(new Key(triggerName, groupName));
            }
            Object[] oArr = list.toArray();
            Key[] kArr = new Key[oArr.length];
            System.arraycopy(oArr, 0, kArr, 0, oArr.length);
            return kArr;
        } finally {
            closeResultSet(rs);
            closeStatement(ps);
        }
    }

    /**
     * <p>
     * Select all of the triggers for jobs that are requesting recovery. The
     * returned trigger objects will have unique "recoverXXX" trigger names and
     * will be in the <code>{@link
     * org.quartz.Scheduler}.DEFAULT_RECOVERY_GROUP</code>
     * trigger group.
     * </p>
     * 
     * <p>
     * In order to preserve the ordering of the triggers, the fire time will be
     * set from the <code>COL_FIRED_TIME</code> column in the <code>TABLE_FIRED_TRIGGERS</code>
     * table. The caller is responsible for calling <code>computeFirstFireTime</code>
     * on each returned trigger. It is also up to the caller to insert the

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产亚洲一区二区三区在线观看| 久久99国产精品成人| 不卡一区二区在线| 国产精品蜜臀av| 99国产精品久久久久久久久久久| 成人欧美一区二区三区小说 | 成人永久免费视频| 欧美国产一区视频在线观看| aaa欧美日韩| 亚洲欧洲日韩女同| 欧美在线综合视频| 日韩成人免费电影| 精品国产一区二区三区av性色| 国产一区二区影院| 国产精品成人免费在线| 91麻豆国产香蕉久久精品| 亚洲午夜免费视频| 精品国产一区二区三区四区四| 国产精品99久| 夜夜嗨av一区二区三区中文字幕 | 成人免费视频caoporn| 中文字幕一区二区三区蜜月| 色94色欧美sute亚洲13| 日韩av一二三| 久久午夜国产精品| 99国产精品国产精品久久| 亚洲成精国产精品女| 精品处破学生在线二十三| 成人av免费网站| 丝袜亚洲精品中文字幕一区| 欧美草草影院在线视频| 91在线视频官网| 日本中文字幕一区二区视频 | 成人激情黄色小说| 5858s免费视频成人| 欧美日韩午夜精品| 91久久人澡人人添人人爽欧美 | 亚洲成av人影院| 日韩欧美色综合| 91在线看国产| 日韩国产精品大片| 国产精品高潮久久久久无| 91精品国产欧美一区二区| a亚洲天堂av| 免费观看在线色综合| 亚洲欧洲另类国产综合| 91精品国产高清一区二区三区| 懂色一区二区三区免费观看| 五月综合激情网| 国产精品传媒入口麻豆| 91精品国产乱| 91电影在线观看| 成人晚上爱看视频| 久久精品国产免费看久久精品| 亚洲黄色尤物视频| 精品国产1区2区3区| 精品视频在线免费看| 成人激情动漫在线观看| 国产在线精品一区二区夜色| 五月婷婷色综合| 亚洲精品国产精品乱码不99 | 亚洲色欲色欲www| 亚洲精品一区二区精华| 欧美日韩精品欧美日韩精品| 日本黄色一区二区| www.亚洲精品| 成人视屏免费看| 国产综合一区二区| 六月丁香综合在线视频| 日韩福利电影在线| 午夜欧美视频在线观看| 亚洲一区二区三区四区不卡| 亚洲天堂av一区| 亚洲色图清纯唯美| 亚洲免费观看视频| 1000精品久久久久久久久| 国产精品乱码妇女bbbb| 国产女同性恋一区二区| 久久精品在线观看| 久久一二三国产| 久久久不卡网国产精品二区| 国产日韩在线不卡| 久久精品男人天堂av| 国产午夜精品理论片a级大结局| 精品国产第一区二区三区观看体验| 日韩视频123| 久久麻豆一区二区| 欧美国产日产图区| 国产精品福利影院| 亚洲精品日韩一| 首页国产欧美久久| 玖玖九九国产精品| 国产九色sp调教91| 91在线精品一区二区三区| 91香蕉国产在线观看软件| 91美女片黄在线观看91美女| 欧美视频中文字幕| 欧美精品亚洲一区二区在线播放| 欧美精品久久天天躁| 精品国产网站在线观看| 久久综合久久综合久久综合| 国产精品久久久久三级| 自拍av一区二区三区| 亚洲一区影音先锋| 日韩高清在线一区| 国产一区二区精品久久99| 成人开心网精品视频| 欧美性色黄大片| 欧美一级免费大片| 国产日本亚洲高清| 一区二区三区四区不卡视频| 午夜伦理一区二区| 国产麻豆成人精品| 色婷婷激情一区二区三区| 欧美男男青年gay1069videost | 亚洲午夜在线视频| 国产资源在线一区| 91猫先生在线| 精品国产伦一区二区三区观看方式| 国产日产欧美一区| 香港成人在线视频| 国产精品原创巨作av| 色狠狠av一区二区三区| 日韩一区二区在线观看视频播放| 国产精品全国免费观看高清| 亚洲成人中文在线| 国产91精品露脸国语对白| 色香蕉久久蜜桃| 亚洲精品一区二区三区福利| 亚洲精品综合在线| 黑人巨大精品欧美一区| 色八戒一区二区三区| 国产亚洲va综合人人澡精品| 亚瑟在线精品视频| www.欧美色图| 日韩精品一区二区在线| 亚洲精品视频在线看| 国产精品羞羞答答xxdd| 91精品国产免费| 亚洲精品v日韩精品| 成人综合婷婷国产精品久久免费| 欧美一级高清片| 一区二区三区在线观看视频 | 日韩国产精品久久久| 99精品在线免费| 久久久一区二区三区| 日韩不卡在线观看日韩不卡视频| 91看片淫黄大片一级| 国产性天天综合网| 久久99精品久久久久久国产越南| 欧美三级电影在线看| 亚洲免费看黄网站| caoporn国产一区二区| 精品国产sm最大网站| 日本强好片久久久久久aaa| 色欲综合视频天天天| 国产日产欧美精品一区二区三区| 国内精品国产成人| 制服丝袜在线91| 丝袜美腿一区二区三区| 91国产福利在线| 中文字幕在线观看不卡视频| 国产a久久麻豆| 久久欧美中文字幕| 国产精品一区二区视频| 欧美成人a∨高清免费观看| 日韩av网站在线观看| 777xxx欧美| 日本亚洲天堂网| 欧美一区永久视频免费观看| 视频在线观看国产精品| 538prom精品视频线放| 亚洲成av人综合在线观看| 91成人在线观看喷潮| 亚洲制服欧美中文字幕中文字幕| 色婷婷精品大在线视频| 亚洲综合999| 欧美日韩色一区| 午夜激情一区二区三区| 欧美日韩免费一区二区三区| 亚洲国产一区视频| 欧美丰满高潮xxxx喷水动漫| 美腿丝袜亚洲一区| 日韩三级电影网址| 国产一区二区女| 中文字幕不卡在线观看| 99久久久免费精品国产一区二区| 日韩一区在线免费观看| 欧美日韩中文一区| 另类小说视频一区二区| 欧美激情一区二区| 一本一本大道香蕉久在线精品 | 天天综合网 天天综合色| 在线电影院国产精品| 极品少妇xxxx偷拍精品少妇| 国产亚洲视频系列| 色综合视频在线观看| 三级在线观看一区二区| 精品福利在线导航| 成人网男人的天堂|