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

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

?? dbusermessagesiterator.java

?? 這是學習Java必須讀懂兩套源代碼
?? JAVA
字號:
/**
 * Copyright (C) 2001 Yasna.com. All rights reserved.
 *
 * ===================================================================
 * The Apache Software License, Version 1.1
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in
 *    the documentation and/or other materials provided with the
 *    distribution.
 *
 * 3. The end-user documentation included with the redistribution,
 *    if any, must include the following acknowledgment:
 *       "This product includes software developed by
 *        Yasna.com (http://www.yasna.com)."
 *    Alternately, this acknowledgment may appear in the software itself,
 *    if and wherever such third-party acknowledgments normally appear.
 *
 * 4. The names "Yazd" and "Yasna.com" must not be used to
 *    endorse or promote products derived from this software without
 *    prior written permission. For written permission, please
 *    contact yazd@yasna.com.
 *
 * 5. Products derived from this software may not be called "Yazd",
 *    nor may "Yazd" appear in their name, without prior written
 *    permission of Yasna.com.
 *
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED.  IN NO EVENT SHALL YASNA.COM OR
 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 * ====================================================================
 *
 * This software consists of voluntary contributions made by many
 * individuals on behalf of Yasna.com. For more information
 * on Yasna.com, please see <http://www.yasna.com>.
 */

/**
 * Copyright (C) 2000 CoolServlets.com. All rights reserved.
 *
 * ===================================================================
 * The Apache Software License, Version 1.1
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in
 *    the documentation and/or other materials provided with the
 *    distribution.
 *
 * 3. The end-user documentation included with the redistribution,
 *    if any, must include the following acknowledgment:
 *       "This product includes software developed by
 *        CoolServlets.com (http://www.coolservlets.com)."
 *    Alternately, this acknowledgment may appear in the software itself,
 *    if and wherever such third-party acknowledgments normally appear.
 *
 * 4. The names "Jive" and "CoolServlets.com" must not be used to
 *    endorse or promote products derived from this software without
 *    prior written permission. For written permission, please
 *    contact webmaster@coolservlets.com.
 *
 * 5. Products derived from this software may not be called "Jive",
 *    nor may "Jive" appear in their name, without prior written
 *    permission of CoolServlets.com.
 *
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED.  IN NO EVENT SHALL COOLSERVLETS.COM OR
 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 * ====================================================================
 *
 * This software consists of voluntary contributions made by many
 * individuals on behalf of CoolServlets.com. For more information
 * on CoolServlets.com, please see <http://www.coolservlets.com>.
 */

package com.Yasna.forum.database;

import java.util.*;
//JDK1.1// import com.sun.java.util.collections.*;
import java.sql.*;
import com.Yasna.forum.*;

/**
 * An Iterator for all the user's Messages in a forum.
 */
public class DbUserMessagesIterator implements Iterator, ListIterator {

    /** DATABASE QUERIES **/
    private static final String USER_MESSAGES =
        "SELECT messageID, yazdMessage.threadID FROM yazdMessage,yazdForum,yazdThread WHERE " +
        "yazdMessage.userID=? AND yazdForum.forumID=? AND " +
        "yazdThread.forumID=yazdForum.forumID AND " +
        "yazdMessage.threadID=yazdThread.threadID";

    private int currentIndex = -1;
    private int [] messages;
    //The threads that correspond to each message.
    private int [] threads;
    private Forum forum;

    private DbForumFactory factory;

    protected DbUserMessagesIterator(DbForumFactory factory, User user, Forum forum)
    {
        this.factory = factory;
        this.forum = forum;
        //We don't know how many results will be returned, so store them
        //in an ArrayList.
        ArrayList tempMessages = new ArrayList();
        ArrayList tempThreads = new ArrayList();
        Connection con = null;
        PreparedStatement pstmt = null;
        try {
            con = DbConnectionManager.getConnection();
            pstmt = con.prepareStatement(USER_MESSAGES);
            pstmt.setInt(1, user.getID());
            pstmt.setInt(2, forum.getID());
            ResultSet rs = pstmt.executeQuery();
            while (rs.next()) {
                tempMessages.add(new Integer(rs.getInt(1)));
                tempThreads.add(new Integer(rs.getInt(2)));
            }
        }
        catch( SQLException sqle ) {
            System.err.println("Error in DbUserMessagesIterator:constructor()-" + sqle);
            sqle.printStackTrace();
        }
        finally {
            try {  pstmt.close(); }
            catch (Exception e) { e.printStackTrace(); }
            try {  con.close();   }
            catch (Exception e) { e.printStackTrace(); }
        }
        //Now copy into an array.
        messages = new int[tempMessages.size()];
        for (int i=0; i<messages.length; i++) {
            messages[i] = ((Integer)tempMessages.get(i)).intValue();
        }
        //Now copy into an array.
        threads = new int[tempThreads.size()];
        for (int i=0; i<threads.length; i++) {
            threads[i] = ((Integer)tempThreads.get(i)).intValue();
        }
    }

    /**
     * Returns true if there are more users left to iteratate through forwards.
     */
    public boolean hasNext() {
        return (currentIndex+1 < messages.length);
    }

    /**
     * Returns true if there are more users left to iteratore through backwards.
     */
    public boolean hasPrevious() {
        return (currentIndex > 0);
    }

    /**
     * Returns the next User.
     */
    public Object next() throws java.util.NoSuchElementException {
        ForumMessage message = null;
        currentIndex++;
        if (currentIndex >= messages.length) {
            throw new java.util.NoSuchElementException();
        }
        try {
            message = forum.getThread(threads[currentIndex]).getMessage(messages[currentIndex]);
        }
        catch (ForumThreadNotFoundException ftnfe) {
            ftnfe.printStackTrace();
        }
        catch (ForumMessageNotFoundException fmnfe) {
            fmnfe.printStackTrace();
        }
        return message;
    }

    /**
     * For security reasons, the add operation is not supported. Use
     * ProfileManager instead.
     *
     * @see ProfileManager
     */
    public void add(Object o) throws UnsupportedOperationException {
        throw new UnsupportedOperationException();
    }

    /**
     * For security reasons, the remove operation is not supported. Use
     * ProfileManager instead.
     *
     * @see ProfileManager
     */
    public void remove() {
        throw new UnsupportedOperationException();
    }

    /**
     * For security reasons, the set operation is not supported. Use
     * ProfileManager instead.
     *
     * @see ProfileManager
     */
    public void set(Object o) throws UnsupportedOperationException {
        throw new UnsupportedOperationException();
    }

    /**
     * Returns the index number that would be returned with a call to next().
     */
    public int nextIndex() {
        return currentIndex+1;
    }

    /**
     * Returns the previous user.
     */
    public Object previous() throws java.util.NoSuchElementException {
        ForumMessage message = null;
        currentIndex--;
        if (currentIndex < 0) {
            currentIndex++;
            throw new java.util.NoSuchElementException();
        }
        try {
            message = forum.getThread(threads[currentIndex]).getMessage(messages[currentIndex]);
        }
        catch (ForumThreadNotFoundException ftnfe) {
            ftnfe.printStackTrace();
        }
        catch (ForumMessageNotFoundException fmnfe) {
            fmnfe.printStackTrace();
        }
        return message;
    }

    /**
     * Returns the index number that would be returned with a call to previous().
     */
    public int previousIndex() {
        return currentIndex-1;
    }
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
免费成人在线观看| 国产欧美日韩三区| 91精品国产综合久久福利| 欧美一区二区三区四区在线观看| 91精品国产综合久久蜜臀| 欧美一级日韩一级| 亚洲成人av资源| 国产日韩欧美激情| 亚洲精品视频一区二区| 高潮精品一区videoshd| 久久无码av三级| 极品少妇xxxx精品少妇偷拍| 欧美一区二区精美| 免费看日韩a级影片| 欧美一区二区三区视频| 看片的网站亚洲| 337p粉嫩大胆噜噜噜噜噜91av| 久久99国内精品| 国产日产亚洲精品系列| 成人avav在线| 亚洲成年人网站在线观看| 欧美日韩精品三区| 国内精品写真在线观看| 成人免费一区二区三区在线观看| 色综合天天综合色综合av | 亚洲综合色成人| 欧美在线观看视频在线| 午夜精彩视频在线观看不卡| 精品国产乱码久久久久久免费| 国内精品久久久久影院色| 国产精品三级电影| 777午夜精品视频在线播放| 国产风韵犹存在线视精品| 亚洲自拍偷拍九九九| 精品福利一二区| 欧美久久免费观看| 福利一区二区在线| 91免费版在线| 国产午夜亚洲精品不卡| 亚洲精品欧美综合四区| 欧美xxxxx裸体时装秀| 欧美性感一区二区三区| 国产成人av电影在线播放| 亚洲国产欧美日韩另类综合| 中文字幕乱码一区二区免费| 日韩欧美一区在线| 在线播放/欧美激情| 在线看国产日韩| 欧洲在线/亚洲| 色婷婷精品大视频在线蜜桃视频| 成人激情免费电影网址| 老司机精品视频在线| 亚洲视频小说图片| 国产精品灌醉下药二区| 久久精品欧美一区二区三区不卡 | 亚洲国产中文字幕在线视频综合 | 欧美成人性战久久| 99麻豆久久久国产精品免费| 亚洲午夜视频在线观看| 欧美精品 国产精品| caoporen国产精品视频| 久久国产乱子精品免费女| 亚洲国产精品一区二区www在线 | 亚洲成在人线免费| 欧美韩国日本不卡| 日韩一区二区在线观看视频 | 欧美日韩1区2区| 国产揄拍国内精品对白| 人人精品人人爱| 奇米在线7777在线精品| 亚洲国产一区二区三区| 亚洲夂夂婷婷色拍ww47| 亚洲青青青在线视频| 成人欧美一区二区三区在线播放| 久久这里只精品最新地址| 精品盗摄一区二区三区| 欧美va在线播放| 国产欧美日本一区二区三区| 成人av电影在线网| 日本一区二区三级电影在线观看 | 国产成人免费av在线| 精品污污网站免费看| 亚洲电影在线免费观看| 一区二区日韩av| 欧美精品一区二区三区蜜臀| 玉足女爽爽91| 午夜国产精品影院在线观看| 一区二区三区精品视频| 色狠狠色噜噜噜综合网| 亚洲欧美日韩小说| 欧美日本一区二区三区四区| 亚洲3atv精品一区二区三区| 欧美精品1区2区| 激情综合一区二区三区| 中国色在线观看另类| 成人一区二区三区中文字幕| 中文字幕日韩精品一区| 在线观看成人小视频| 日本中文字幕一区二区有限公司| 欧美成人一区二区| 国产成人亚洲综合色影视| 亚洲图片激情小说| 91精品国产欧美日韩| 激情综合色综合久久| 国产欧美一区二区精品秋霞影院 | 国产精品主播直播| 中日韩免费视频中文字幕| 欧美日韩在线观看一区二区| 久久国产精品99久久久久久老狼| 久久先锋影音av鲁色资源网| 91老师片黄在线观看| 日本伊人精品一区二区三区观看方式| 精品国产亚洲在线| 91美女在线观看| 麻豆国产精品视频| 亚洲欧美日本在线| 精品电影一区二区三区| 91成人在线观看喷潮| 国产精品亚洲成人| 亚洲成人精品一区| 国产亲近乱来精品视频| 欧美精品xxxxbbbb| av影院午夜一区| 久久草av在线| 亚洲一区二区三区四区不卡| 精品久久五月天| 欧美日韩免费高清一区色橹橹| 国产一区二区三区| 日韩av午夜在线观看| 亚洲男同性恋视频| 亚洲国产高清aⅴ视频| 欧美一级日韩免费不卡| 欧美亚洲综合在线| 91免费观看视频在线| 国v精品久久久网| 韩国成人福利片在线播放| 日日欢夜夜爽一区| 亚洲一区二区精品视频| 亚洲欧美日韩一区二区 | 91麻豆精品国产91久久久更新时间| 成人中文字幕合集| 狠狠久久亚洲欧美| 国产一区二区三区在线观看免费视频| 亚洲国产精品视频| 亚洲一区二区精品久久av| 亚洲美女屁股眼交3| 国产精品高清亚洲| 国产精品视频一区二区三区不卡| 欧美精品一区二区在线播放| 日韩欧美第一区| 欧美一级片在线观看| 日韩一区二区影院| 日韩一级完整毛片| 91麻豆精品国产91久久久久久| 91 com成人网| 精品国产一区二区亚洲人成毛片| 欧美一区二区在线看| 日韩午夜av电影| 久久久久久9999| 国产精品色噜噜| 亚洲精品一二三| 亚洲成人精品影院| 麻豆精品一二三| 国产精品一区在线观看乱码| 国产成人福利片| 激情欧美一区二区| 欧美无砖砖区免费| 精品国产欧美一区二区| 欧美国产日韩精品免费观看| 99久久精品情趣| 91美女蜜桃在线| 欧美视频一区在线观看| 欧美一级一级性生活免费录像| 欧美系列一区二区| 日韩欧美一二三| 久久久久国产精品人| 国产精品欧美一区喷水| 亚洲精品你懂的| 美腿丝袜亚洲综合| www.亚洲精品| 91麻豆精品国产91久久久久久| 久久久久久久久久久久久久久99 | 国产成人在线影院| 色综合一区二区三区| 5月丁香婷婷综合| 日本一区二区三区国色天香| 亚洲午夜久久久久中文字幕久| 蜜臀精品一区二区三区在线观看| 国产99久久久精品| 欧美日韩情趣电影| 日本一区二区三区四区| 亚洲尤物在线视频观看| 国产精品99久久久久| 欧美日韩一区三区| 国产视频一区在线播放| 亚洲大片在线观看| 99久久精品一区| 久久久久久亚洲综合| 天堂蜜桃91精品| 色哟哟欧美精品|