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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? dbuseriterator.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.Iterator;
import java.util.ListIterator;
import java.util.ArrayList;
import java.sql.*;
import com.Yasna.forum.*;

/**
 * An Iterator for all the users in the system. Those wishing to integrate
 * Jive into their own User system should also modify this class.
 */
public class DbUserIterator implements Iterator, ListIterator {

    /** DATABASE QUERIES **/
    private static final String ALL_USERS =
        "SELECT userID from yazdUser";

    private int currentIndex = -1;
    private int [] users;

    private ProfileManager profileManager;

    protected DbUserIterator(ProfileManager profileManager) {
        this.profileManager = profileManager;
        //We don't know how many results will be returned, so store them
        //in an ArrayList.
        ArrayList tempUsers = new ArrayList();
        Connection con = null;
        PreparedStatement pstmt = null;
        try {
            con = DbConnectionManager.getConnection();
            pstmt = con.prepareStatement(ALL_USERS);
            ResultSet rs = pstmt.executeQuery();
            while (rs.next()) {
                tempUsers.add(new Integer(rs.getInt("userID")));
            }
        }
        catch( SQLException sqle ) {
            System.err.println("Error in DbUserIterator:constructor()-" + sqle);
        }
        finally {
            try {  pstmt.close(); }
            catch (Exception e) { e.printStackTrace(); }
            try {  con.close();   }
            catch (Exception e) { e.printStackTrace(); }
        }
        //Now copy into an array.
        users = new int[tempUsers.size()];
        for (int i=0; i<users.length; i++) {
            users[i] = ((Integer)tempUsers.get(i)).intValue();
        }
    }

    protected DbUserIterator(ProfileManager profileManager, int startIndex,
            int numResults)
    {
        this.profileManager = profileManager;

        int[] tempUsers = new int[numResults];
        //It's very possible that there might not be as many results to get
        //as we requested. Therefore, we keep track of how many results we
        //get by keeping a count.
        int userCount = 0;

        Connection con = null;
        PreparedStatement pstmt = null;

        try {
            con = DbConnectionManager.getConnection();
            pstmt = con.prepareStatement(ALL_USERS);
            ResultSet rs = pstmt.executeQuery();
            //Move to start of index
            for (int i=0; i<startIndex; i++) {
                rs.next();
            }
            //Now read in desired number of results
            for (int i=0; i<numResults; i++) {
                if (rs.next()) {
                    tempUsers[userCount] = rs.getInt("userID");
                    userCount++;
                }
                else {
                    break;
                }
            }
        }
        catch( SQLException sqle ) {
            System.err.println("Error in DbUserIterator:constructor()-" + sqle);
        }
        finally {
            try {  pstmt.close(); }
            catch (Exception e) { e.printStackTrace(); }
            try {  con.close();   }
            catch (Exception e) { e.printStackTrace(); }
        }
        users = new int[userCount];
        for (int i=0; i<userCount; i++) {
            users[i] = tempUsers[i];
        }
    }

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

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

    /**
     * Returns the next User.
     *
     * @return the next User.
     * @throws NoSuchElementException if there are no more elements to return.
     */
    public Object next() throws java.util.NoSuchElementException {
        User user = null;
        currentIndex++;
        if (currentIndex >= users.length) {
            throw new java.util.NoSuchElementException();
        }
        try {
            user = profileManager.getUser(users[currentIndex]);
        }
        catch (UserNotFoundException gnfe) {
            gnfe.printStackTrace();
        }
        return user;
    }

    /**
     * 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 {
        User user = null;
        currentIndex--;
        if (currentIndex < 0) {
            currentIndex++;
            throw new java.util.NoSuchElementException();
        }
        try {
            user = profileManager.getUser(users[currentIndex]);
        }
        catch (UserNotFoundException gnfe) {
            System.err.println(gnfe);
        }
        return user;
    }

    /**
     * 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一区二区三区免费野_久草精品视频
在线亚洲欧美专区二区| 久久综合999| 久久网站热最新地址| 国产精品黄色在线观看| 男男视频亚洲欧美| 色天使久久综合网天天| 欧美激情艳妇裸体舞| 麻豆精品国产传媒mv男同| 一本一道久久a久久精品综合蜜臀| 欧美刺激午夜性久久久久久久 | 99久久精品久久久久久清纯| 精品国产91乱码一区二区三区| 亚洲欧美自拍偷拍| 国产精品主播直播| 日韩精品中文字幕一区二区三区| 亚洲小说欧美激情另类| 色综合久久综合中文综合网| 中文字幕免费不卡在线| 久久99久久99精品免视看婷婷| 欧美精品在线观看播放| 亚洲影院理伦片| 欧美性xxxxx极品少妇| 亚洲免费观看视频| 色婷婷精品久久二区二区蜜臀av| 亚洲三级小视频| 91在线观看地址| 国产精品黄色在线观看| www.欧美日韩| 国产精品久久久久久久久晋中 | 美女高潮久久久| 91精品国产色综合久久ai换脸| 丝袜亚洲精品中文字幕一区| 欧美日韩激情一区二区| 亚洲午夜在线电影| 欧美日本视频在线| 美女国产一区二区| 欧美精品一区二区三区四区| 国产麻豆精品theporn| 国产日韩欧美一区二区三区乱码 | 色系网站成人免费| 亚洲欧美一区二区久久| 色婷婷久久99综合精品jk白丝| 亚洲va欧美va人人爽午夜| 91精品福利在线一区二区三区| 美女视频黄 久久| 日本一区二区三区四区在线视频| 成人免费电影视频| 一区二区三区久久久| 制服丝袜av成人在线看| 国产伦精品一区二区三区视频青涩 | 秋霞av亚洲一区二区三| 久久久av毛片精品| 97精品超碰一区二区三区| 亚洲图片欧美视频| 日韩你懂的电影在线观看| 国产高清精品在线| 亚洲激情图片小说视频| 91精品国产乱| 成人sese在线| 午夜欧美视频在线观看| 欧美精品一区男女天堂| 色诱亚洲精品久久久久久| 蜜桃视频一区二区三区在线观看| 国产日韩欧美高清在线| 在线观看日韩电影| 韩国欧美一区二区| 亚洲一区二区综合| 久久久激情视频| 欧美日韩的一区二区| 一道本成人在线| 麻豆精品久久精品色综合| 亚洲欧美国产三级| 久久久久青草大香线综合精品| 91久久精品一区二区三| 激情综合色播激情啊| 一区二区三区在线观看网站| 日韩欧美国产精品| 色美美综合视频| 国产乱人伦精品一区二区在线观看| 日韩理论片一区二区| 精品国产电影一区二区| 欧美优质美女网站| 成人手机电影网| 免费不卡在线观看| 亚洲已满18点击进入久久| 国产午夜精品久久久久久久| 欧美日本韩国一区二区三区视频| 成人福利视频在线看| 国产一区在线观看麻豆| 热久久一区二区| 亚洲mv在线观看| 一区二区三区四区在线播放| 中文字幕av一区二区三区免费看| 日韩亚洲欧美一区| 欧美日韩亚洲综合一区| 色噜噜久久综合| 成人午夜视频在线| 国产伦精品一区二区三区视频青涩| 天堂蜜桃一区二区三区| 亚洲午夜激情网页| 亚洲一区二区三区视频在线| 亚洲精品成人悠悠色影视| 中文字幕一区二区三区色视频| 久久―日本道色综合久久| 日韩欧美中文一区| 欧美一级艳片视频免费观看| 欧美精品久久一区| 欧美一区二区视频免费观看| 欧美人伦禁忌dvd放荡欲情| 欧美性受xxxx黑人xyx性爽| 在线免费观看日韩欧美| 一本到不卡免费一区二区| 91在线观看一区二区| 91丝袜国产在线播放| 99久久99久久精品国产片果冻| av高清久久久| 色婷婷一区二区三区四区| 色悠悠亚洲一区二区| 欧美自拍偷拍午夜视频| 欧美亚洲图片小说| 欧美色倩网站大全免费| 欧美日韩精品是欧美日韩精品| 欧美日韩国产在线观看| 欧美美女直播网站| 欧美一区二区免费观在线| 欧美xxx久久| 欧美激情一区二区在线| 亚洲色图制服诱惑 | 国产精品高潮呻吟| 亚洲婷婷在线视频| 亚洲国产wwwccc36天堂| 五月婷婷久久丁香| 国产资源精品在线观看| 国产suv精品一区二区三区| 99久久久久免费精品国产| 欧美午夜片在线看| 日韩欧美一二三区| 国产精品国产馆在线真实露脸 | 国产欧美一区二区精品忘忧草 | 日韩欧美国产综合| 国产精品嫩草影院av蜜臀| 亚洲图片另类小说| 午夜成人免费电影| 国产一区二区伦理| 91久久国产最好的精华液| 91精品国产综合久久久久| 精品国产91九色蝌蚪| 亚洲精品视频自拍| 久草精品在线观看| www.色综合.com| 欧美一区二区二区| 日本一区二区三区国色天香| 亚洲午夜免费福利视频| 精品夜夜嗨av一区二区三区| 91色在线porny| 欧美成人猛片aaaaaaa| 一区二区三区在线观看欧美| 韩国精品免费视频| 在线观看av一区二区| 久久精品亚洲麻豆av一区二区| 亚洲图片自拍偷拍| 99久久免费国产| 精品国产精品一区二区夜夜嗨| 亚洲一区二区三区四区的| 国产成人无遮挡在线视频| 91精品国产入口| 亚洲美女区一区| 丁香桃色午夜亚洲一区二区三区| 欧美老肥妇做.爰bbww| 亚洲天堂免费在线观看视频| 国产精品888| 日韩免费福利电影在线观看| 亚洲资源中文字幕| 成人免费毛片嘿嘿连载视频| 欧美岛国在线观看| 日韩国产精品久久| 欧洲精品中文字幕| 亚洲欧美在线观看| 大美女一区二区三区| 欧美大片一区二区| 七七婷婷婷婷精品国产| 欧美日韩一二区| 亚洲自拍都市欧美小说| 91免费国产在线| 中文字幕一区二区三区四区不卡 | 国产精品1区2区| 91精品国产综合久久久蜜臀粉嫩 | 99国产精品久久久久久久久久| 日韩欧美在线1卡| 奇米777欧美一区二区| 欧美日韩另类一区| 婷婷丁香久久五月婷婷| 欧美视频一区二区三区四区 | 亚洲国产日韩精品| 在线亚洲精品福利网址导航| 亚洲另类春色校园小说| 99久久婷婷国产综合精品 | 91捆绑美女网站| 亚洲色图视频网站| 99久久精品一区二区|