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

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

?? dbprofilemanager.java

?? Jvie論壇的程序
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
/**
 * 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.*;
import java.sql.*;
import com.Yasna.forum.*;
import com.Yasna.util.*;

/**
 * Database implementation of the ProfileManager interface.
 */
public class DbProfileManager implements ProfileManager {

    /** DATABASE QUERIES **/
    private static final String USER_GROUPS =
        "SELECT groupID from yazdGroupUser WHERE userID=?";
    private static final String USER_MESSAGE_COUNT =
        "SELECT count(*) FROM yazdMessage,yazdForum,yazdThread WHERE " +
        "yazdMessage.userID=? AND yazdForum.forumID=? AND " +
        "yazdThread.forumID=yazdForum.forumID AND " +
        "yazdMessage.threadID=yazdThread.threadID";
    private static final String USER_COUNT = "SELECT count(*) FROM yazdUser";
    private static final String ALL_USER_MESSAGES =
        "SELECT messageID FROM yazdMessage WHERE userID=?";
    private static final String DELETE_USER_MESSAGES =
        "UPDATE yazdMessage set userID=-1 WHERE userID=?";
    private static final String DELETE_USER_PERMS =
        "DELETE FROM yazdUserPerm WHERE userID=?";
    private static final String DELETE_USER_GROUPS =
        "DELETE FROM yazdGroupUser WHERE userID=?";
    private static final String DELETE_USER_PROPS =
        "DELETE FROM yazdUserProp WHERE userID=?";
    private static final String DELETE_USER =
        "DELETE FROM yazdUser WHERE userID=?";
    private static final String GROUP_COUNT = "SELECT count(*) FROM yazdGroup";
    private static final String DELETE_GROUP_USERS =
        "DELETE FROM yazdGroupUser WHERE groupID=?";
    private static final String DELETE_GROUP =
        "DELETE FROM yazdGroup WHERE groupID=?";

    private User anonymousUser = null;
    private User specialUser = null;
    private DbForumFactory factory;

    /**
     * Creates a new ProfileManager.
     */
    public DbProfileManager(DbForumFactory factory) {
        this.factory = factory;
        try {
            anonymousUser = getUser(-1);
            specialUser = getUser(0);
        }
        catch (UserNotFoundException unfe) {  }
    }

    //FROM THE PROFILEMANAGER INTERFACE//

    public User createUser(String username, String password, String email)
            throws UserAlreadyExistsException
    {
        User newUser = null;
        try {
            User existingUser = getUser(username);

            //The user already exists since now exception, so:
            throw new UserAlreadyExistsException();
        }
        catch (UserNotFoundException unfe) {
            //The user doesn't already exist so we can create a new user
            newUser = new DbUser(username, password, email);
        }
        return newUser;
    }

    public User getUser(int userID) throws UserNotFoundException {
        DbCacheManager cacheManager = factory.getCacheManager();
        //If cache is not enabled, do a new lookup of object
        if (!cacheManager.isCacheEnabled()) {
            return new DbUser(userID);
        }
        //Cache is enabled.
        Integer userIDInteger = new Integer(userID);
        DbUser user = (DbUser)cacheManager.get(
                DbCacheManager.USER_CACHE,
                userIDInteger
        );
        if(user == null) {
            user = new DbUser(userID);
            cacheManager.add(DbCacheManager.USER_CACHE, userIDInteger, user);
        }
        return user;
    }

    public User getUser(String username) throws UserNotFoundException {
        DbCacheManager cacheManager = factory.getCacheManager();
        //If cache is not enabled, do a new lookup of object
        if (!cacheManager.isCacheEnabled()) {
            User user = new DbUser(username);
            return getUser(user.getID());
        }
        //Cache is enabled.
        CacheableInteger userIDInteger = (CacheableInteger)cacheManager.get(
                DbCacheManager.USER_ID_CACHE,
                username
        );
        //if id wan't found in cache, load it up and put it there.
        if (userIDInteger == null) {
            User user = new DbUser(username);
            userIDInteger = new CacheableInteger(new Integer(user.getID()));
            cacheManager.add(DbCacheManager.USER_ID_CACHE, username, userIDInteger);
        }
        return getUser(userIDInteger.getInteger().intValue());
    }

    public User getAnonymousUser() {
        return anonymousUser;
    }

    public User getSpecialUser() {
        return specialUser;
    }

    public void deleteUser(User user) throws UnauthorizedException {
        int userID = user.getID();
        int [] messages;
        //Get array of all user's messages in the system so that
        //we can expire them from cache.
        ArrayList tempMessages = new ArrayList();
        Connection con = null;
        PreparedStatement pstmt = null;
        try {
            con = DbConnectionManager.getConnection();
            pstmt = con.prepareStatement(ALL_USER_MESSAGES);
            pstmt.setInt(1, user.getID());
            ResultSet rs = pstmt.executeQuery();
            while (rs.next()) {
                tempMessages.add(new Integer(rs.getInt("messageID")));
            }
        }
        catch( SQLException sqle ) {
            System.err.println("Error in DbProfileManager:deleteUser()-" + 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();
        }

        con = null;
        pstmt = null;
        try {
            con = DbConnectionManager.getConnection();
            //mark all message by user as anonymous
            pstmt = con.prepareStatement(DELETE_USER_MESSAGES);
            pstmt.setInt(1,userID);
            pstmt.execute();
            pstmt.close();
            //remove all permissions given to user
            pstmt = con.prepareStatement(DELETE_USER_PERMS);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩精品一区国产麻豆| 亚洲与欧洲av电影| 一区二区久久久| 国产毛片精品一区| 日韩一二三区不卡| 一区二区三区中文字幕在线观看| 91一区一区三区| 欧美日韩精品三区| 国产精品久久久久影院亚瑟 | 亚洲狠狠丁香婷婷综合久久久| 天天操天天干天天综合网| 成人午夜视频网站| 26uuu亚洲综合色欧美| 亚洲二区视频在线| 国产suv精品一区二区883| 欧美成人乱码一区二区三区| 欧美a级一区二区| 国产99久久久国产精品免费看| 一区二区三区不卡视频| 国产麻豆精品在线观看| 久久久久亚洲综合| 国产欧美一区二区精品性色超碰 | 国产色91在线| 亚洲综合一区二区精品导航| 成人免费高清在线| 国产亚洲欧美色| 蜜乳av一区二区| 欧美日韩精品电影| 亚洲国产成人porn| 欧美在线免费观看视频| 一区二区视频在线| 国产高清精品在线| 久久久久久久久久久久电影| 国产精品一区二区男女羞羞无遮挡 | 成人欧美一区二区三区小说| 国产成人欧美日韩在线电影| 久久影视一区二区| 国产精品一二三区| 国产精品女主播av| 91在线国产福利| 一区二区不卡在线视频 午夜欧美不卡在| 成人动漫一区二区三区| 中文字幕色av一区二区三区| 国产91清纯白嫩初高中在线观看| 中文无字幕一区二区三区| 成人app网站| 亚洲第一福利一区| 日韩一区二区三区电影 | 日韩主播视频在线| 欧美精品丝袜久久久中文字幕| 视频在线在亚洲| 精品999在线播放| 国产精品一区三区| 中文字幕一区二区在线观看| 一本到一区二区三区| 亚洲制服丝袜av| 欧美xxxx老人做受| www.欧美精品一二区| 亚洲国产精品久久久久秋霞影院| 日韩欧美一区二区不卡| 国产999精品久久| 亚洲综合久久久| 亚洲精品在线电影| 日本乱人伦一区| 久久国产日韩欧美精品| 综合欧美一区二区三区| 3d动漫精品啪啪一区二区竹菊| 国产精品中文字幕一区二区三区| 亚洲欧美一区二区不卡| 制服丝袜亚洲播放| www.成人在线| 久久久久久久久久久久电影| 国产精品免费aⅴ片在线观看| 色噜噜狠狠一区二区三区果冻| 亚洲视频一区二区免费在线观看 | 亚洲一区二区在线观看视频| 欧美一级午夜免费电影| 久久国产精品72免费观看| 亚洲欧洲综合另类在线| 日韩欧美一级特黄在线播放| 成人免费观看av| 捆绑紧缚一区二区三区视频| 亚洲资源中文字幕| 国产无人区一区二区三区| 欧美丰满少妇xxxbbb| 99精品视频在线播放观看| 五月婷婷久久综合| 亚洲婷婷综合色高清在线| 久久一日本道色综合| 色菇凉天天综合网| 成人深夜视频在线观看| 婷婷激情综合网| 一区二区三区精密机械公司| 欧美精品一区视频| 日韩欧美在线1卡| 欧美日韩高清一区二区三区| 99精品国产热久久91蜜凸| 国产麻豆日韩欧美久久| 精品在线免费视频| 麻豆精品久久久| 蜜臀久久久99精品久久久久久| 亚洲成人午夜电影| 亚洲视频一区二区免费在线观看| 精品久久久久99| 日韩一区二区不卡| 91精品国产综合久久福利软件 | 激情综合色综合久久| 免费观看30秒视频久久| 丝袜a∨在线一区二区三区不卡| 自拍偷拍亚洲欧美日韩| 欧美性生活一区| 一本色道久久综合狠狠躁的推荐 | 91视频免费看| 成人永久看片免费视频天堂| 黄网站免费久久| 久久精品久久久精品美女| 视频一区二区三区入口| 亚洲午夜私人影院| 亚洲国产va精品久久久不卡综合| 亚洲精品第1页| 亚洲国产成人高清精品| 日本亚洲三级在线| 韩国午夜理伦三级不卡影院| 国产综合色产在线精品| 粉嫩欧美一区二区三区高清影视| 成人激情电影免费在线观看| 91视频www| 欧美日韩另类国产亚洲欧美一级| 91精品国产免费| 2021中文字幕一区亚洲| 国产精品午夜在线观看| 亚洲欧美日韩久久| 天天综合天天做天天综合| 久久精品99久久久| 盗摄精品av一区二区三区| 91无套直看片红桃| 宅男噜噜噜66一区二区66| 精品国产一区二区三区忘忧草| 日本一区二区三区在线不卡| 亚洲欧美视频一区| 日本aⅴ免费视频一区二区三区| 在线欧美日韩国产| 欧美α欧美αv大片| 国产精品久久久99| 午夜欧美2019年伦理| 国产在线精品国自产拍免费| bt欧美亚洲午夜电影天堂| eeuss鲁一区二区三区| 色爱区综合激月婷婷| 日韩你懂的在线观看| 亚洲色图欧美激情| 午夜精品福利一区二区三区蜜桃| 午夜视频一区二区| 国产盗摄女厕一区二区三区| 欧美亚洲动漫另类| 国产午夜亚洲精品理论片色戒| 一区二区三区四区五区视频在线观看| 蜜桃av噜噜一区| 日本福利一区二区| 国产亚洲精品aa午夜观看| 午夜电影一区二区三区| 成人福利视频网站| 欧美一区二区在线播放| 悠悠色在线精品| 国产精品一二三四| 欧美电影在线免费观看| 亚洲欧美激情在线| 国产精品88av| 欧美女孩性生活视频| 国产嫩草影院久久久久| 蜜臀久久久99精品久久久久久| 91免费国产在线| 国产精品美女一区二区| 麻豆精品久久精品色综合| 91碰在线视频| 国产精品乱子久久久久| 精品伊人久久久久7777人| 欧美日韩在线直播| 国产欧美一区在线| 国产真实乱对白精彩久久| 91精品在线免费观看| 偷拍亚洲欧洲综合| 色综合天天狠狠| 亚洲人成电影网站色mp4| 国产一区二区三区高清播放| 日韩欧美一级精品久久| 性感美女极品91精品| 欧美调教femdomvk| 一区2区3区在线看| 色哟哟一区二区| 一区二区三区四区激情 | 亚洲色图.com| 国产精品一线二线三线精华| 91精品国产一区二区三区香蕉| 亚洲日本在线看| 91蜜桃网址入口| 樱花影视一区二区| 欧美日韩中文另类| 性做久久久久久久久| 日韩视频免费直播|