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

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

?? memberforumdaoimpljdbc.java

?? java servlet著名論壇源代碼
?? JAVA
字號(hào):
/*
 * $Header: /cvsroot/mvnforum/mvnforum/src/com/mvnforum/db/jdbc/MemberForumDAOImplJDBC.java,v 1.2 2004/01/18 19:13:11 minhnn Exp $
 * $Author: minhnn $
 * $Revision: 1.2 $
 * $Date: 2004/01/18 19:13:11 $
 *
 * ====================================================================
 *
 * Copyright (C) 2002-2004 by MyVietnam.net
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or any later version.
 *
 * All copyright notices regarding mvnForum MUST remain intact
 * in the scripts and in the outputted HTML.
 * The "powered by" text/logo with a link back to
 * http://www.mvnForum.com and http://www.MyVietnam.net in the
 * footer of the pages MUST remain visible when the pages
 * are viewed on the internet or intranet.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 * Support can be obtained from support forums at:
 * http://www.mvnForum.com/mvnforum/index
 *
 * Correspondence and Marketing Questions can be sent to:
 * info@MyVietnam.net
 *
 * @author: Minh Nguyen  minhnn@MyVietnam.net
 * @author: Mai  Nguyen  mai.nh@MyVietnam.net
 */
package com.mvnforum.db.jdbc;

import java.sql.*;
import java.util.ArrayList;
import java.util.Collection;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import com.mvnforum.db.*;
import net.myvietnam.mvncore.db.DBUtils;
import net.myvietnam.mvncore.exception.*;

public class MemberForumDAOImplJDBC implements MemberForumDAO {

    private static Log log = LogFactory.getLog(MemberForumDAOImplJDBC.class);

    // this variable will support caching if cache for this class is needed
    private static boolean m_dirty = true;

    // Prevent instantiation from classes other than derived classes
    public MemberForumDAOImplJDBC() {
    }

    protected static boolean isDirty() {
        return m_dirty;
    }

    protected static void setDirty(boolean dirty) {
        m_dirty = dirty;
    }

    public void findByPrimaryKey(int memberID, int forumID, int permission)
        throws ObjectNotFoundException, DatabaseException {

        Connection connection = null;
        PreparedStatement statement = null;
        ResultSet resultSet = null;
        StringBuffer sql = new StringBuffer(512);
        sql.append("SELECT MemberID, ForumID, Permission");
        sql.append(" FROM " + TABLE_NAME);
        sql.append(" WHERE MemberID = ? AND ForumID = ? AND Permission = ?");
        try {
            connection = DBUtils.getConnection();
            statement = connection.prepareStatement(sql.toString());
            statement.setInt(1, memberID);
            statement.setInt(2, forumID);
            statement.setInt(3, permission);
            resultSet = statement.executeQuery();
            if (!resultSet.next()) {
                throw new ObjectNotFoundException("Cannot find the primary key (" + memberID + ", " + forumID + ", " + permission + ") in table 'MemberForum'.");
            }
        } catch(SQLException sqle) {
            log.error("Sql Execution Error!", sqle);
            throw new DatabaseException("Error executing SQL in MemberForumDAOImplJDBC.findByPrimaryKey.");
        } finally {
            DBUtils.closeResultSet(resultSet);
            DBUtils.closeStatement(statement);
            DBUtils.closeConnection(connection);
        }
    }

    /*
     * Included columns: MemberID, ForumID, Permission
     * Excluded columns:
     */
    public void create(int memberID, int forumID, int permission)
        throws CreateException, DatabaseException, DuplicateKeyException, ForeignKeyNotFoundException {

        // @todo: comment this try-catch block if the needed columns dont have attribute 'include'
        // If this is the case, then it is highly recommended that you regenerate this method with the attribute 'include' turned on
        // However, if primary key is a auto_increment column, then you can safely delete this block
        try {
            //Check if primary key already exists
            findByPrimaryKey(memberID, forumID, permission);
            //If so, then we have to throw an exception
            throw new DuplicateKeyException("Primary key already exists. Cannot create new MemberForum with the same <MemberID, ForumID, Permission> (" + memberID + ", " + forumID + ", " + permission + ").");
        } catch(ObjectNotFoundException e) {
            //Otherwise we can go ahead
        }

        if (memberID!=0) {
            try {
                // @todo: modify the parameter list as needed
                // You may have to regenerate this method if the needed columns dont have attribute 'include'
                DAOFactory.getMemberDAO().findByPrimaryKey(memberID);
            } catch(ObjectNotFoundException e) {
                throw new ForeignKeyNotFoundException("Foreign key refers to table 'mvnforumMember' does not exist. Cannot create new MemberForum.");
            }
        }

        try {
            // @todo: modify the parameter list as needed
            // You may have to regenerate this method if the needed columns dont have attribute 'include'
            DAOFactory.getForumDAO().findByPrimaryKey(forumID);
        } catch(ObjectNotFoundException e) {
            throw new ForeignKeyNotFoundException("Foreign key refers to table 'mvnforumForum' does not exist. Cannot create new MemberForum.");
        }

        Connection connection = null;
        PreparedStatement statement = null;
        StringBuffer sql = new StringBuffer(512);
        sql.append("INSERT INTO " + TABLE_NAME + " (MemberID, ForumID, Permission)");
        sql.append(" VALUES (?, ?, ?)");
        try {
            connection = DBUtils.getConnection();
            statement = connection.prepareStatement(sql.toString());

            statement.setInt(1, memberID);
            statement.setInt(2, forumID);
            statement.setInt(3, permission);

            if (statement.executeUpdate() != 1) {
                throw new CreateException("Error adding a row into table 'MemberForum'.");
            }
            m_dirty = true;
        } catch(SQLException sqle) {
            log.error("Sql Execution Error!", sqle);
            throw new DatabaseException("Error executing SQL in MemberForumDAOImplJDBC.create.");
        } finally {
            DBUtils.closeStatement(statement);
            DBUtils.closeConnection(connection);
        }
    }

    public void delete(int memberID, int forumID, int permission)
        throws DatabaseException, ObjectNotFoundException {

        Connection connection = null;
        PreparedStatement statement = null;
        StringBuffer sql = new StringBuffer(512);
        sql.append("DELETE FROM " + TABLE_NAME);
        sql.append(" WHERE MemberID = ? AND ForumID = ? AND Permission = ?");

        try {
            connection = DBUtils.getConnection();
            statement = connection.prepareStatement(sql.toString());
            statement.setInt(1, memberID);
            statement.setInt(2, forumID);
            statement.setInt(3, permission);
            if (statement.executeUpdate() != 1) {
                throw new ObjectNotFoundException("Cannot delete a row in table MemberForum where primary key = (" + memberID + ", " + forumID + ", " + permission + ").");
            }
            m_dirty = true;
        } catch(SQLException sqle) {
            log.error("Sql Execution Error!", sqle);
            throw new DatabaseException("Error executing SQL in MemberForumDAOImplJDBC.delete.");
        } finally {
            DBUtils.closeStatement(statement);
            DBUtils.closeConnection(connection);
        }
    }

    public void delete_inMember(int memberID)
        throws DatabaseException {

        Connection connection = null;
        PreparedStatement statement = null;
        StringBuffer sql = new StringBuffer(512);
        sql.append("DELETE FROM " + TABLE_NAME);
        sql.append(" WHERE MemberID = ?");

        try {
            connection = DBUtils.getConnection();
            statement = connection.prepareStatement(sql.toString());
            statement.setInt(1, memberID);
            statement.executeUpdate();
            m_dirty = true;
        } catch(SQLException sqle) {
            log.error("Sql Execution Error!", sqle);
            throw new DatabaseException("Error executing SQL in MemberForumDAOImplJDBC.delete_inMember.");
        } finally {
            DBUtils.closeStatement(statement);
            DBUtils.closeConnection(connection);
        }
    }

    public void delete_inForum(int forumID)
        throws DatabaseException {

        Connection connection = null;
        PreparedStatement statement = null;
        StringBuffer sql = new StringBuffer(512);
        sql.append("DELETE FROM " + TABLE_NAME);
        sql.append(" WHERE ForumID = ? ");

        try {
            connection = DBUtils.getConnection();
            statement = connection.prepareStatement(sql.toString());
            statement.setInt(1, forumID);

            statement.executeUpdate();
            m_dirty = true;
        } catch(SQLException sqle) {
            log.error("Sql Execution Error!", sqle);
            throw new DatabaseException("Error executing SQL in MemberForumDAOImplJDBC.delete_inForum.");
        } finally {
            DBUtils.closeStatement(statement);
            DBUtils.closeConnection(connection);
        }
    }

    /*
     * Included columns: Permission
     * Excluded columns: MemberID, ForumID
     */
    public Collection getBeans_inMemberForum(int memberID, int forumID)
        throws DatabaseException {

        Connection connection = null;
        PreparedStatement statement = null;
        ResultSet resultSet = null;
        Collection retValue = new ArrayList();
        StringBuffer sql = new StringBuffer(512);
        sql.append("SELECT Permission");
        sql.append(" FROM " + TABLE_NAME);
        sql.append(" WHERE MemberID = ? AND ForumID = ?");
        try {
            connection = DBUtils.getConnection();
            statement = connection.prepareStatement(sql.toString());
            statement.setInt(1, memberID);
            statement.setInt(2, forumID);

            resultSet = statement.executeQuery();
            while (resultSet.next()) {
                MemberForumBean bean = new MemberForumBean();
                bean.setMemberID(memberID);
                bean.setForumID(forumID);
                bean.setPermission(resultSet.getInt("Permission"));
                retValue.add(bean);
            }
            return retValue;
        } catch (SQLException sqle) {
            log.error("Sql Execution Error!", sqle);
            throw new DatabaseException("Error executing SQL in MemberForumDAOImplJDBC.getBeans_inMemberForum.");
        } finally {
            DBUtils.closeResultSet(resultSet);
            DBUtils.closeStatement(statement);
            DBUtils.closeConnection(connection);
        }
    }

    /*
     * Included columns: MemberID, ForumID, Permission
     * Excluded columns:
     */
    public Collection getBeans_inMember(int memberID)
        throws DatabaseException {

        Connection connection = null;
        PreparedStatement statement = null;
        ResultSet resultSet = null;
        Collection retValue = new ArrayList();

        StringBuffer sql = new StringBuffer(512);
        sql.append("SELECT MemberID, ForumID, Permission");
        sql.append(" FROM " + TABLE_NAME);
        sql.append(" WHERE MemberID = ?");
        try {
            connection = DBUtils.getConnection();
            statement = connection.prepareStatement(sql.toString());
            statement.setInt(1, memberID);
            resultSet = statement.executeQuery();
            while (resultSet.next()) {
                MemberForumBean bean = new MemberForumBean();
                bean.setMemberID(resultSet.getInt("MemberID"));
                bean.setForumID(resultSet.getInt("ForumID"));
                bean.setPermission(resultSet.getInt("Permission"));
                retValue.add(bean);
            }
            return retValue;
        } catch (SQLException sqle) {
            log.error("Sql Execution Error!", sqle);
            throw new DatabaseException("Error executing SQL in MemberForumDAOImplJDBC.getBeans_inMember.");
        } finally {
            DBUtils.closeResultSet(resultSet);
            DBUtils.closeStatement(statement);
            DBUtils.closeConnection(connection);
        }
    }

    /*
     * Included columns: MemberID, ForumID, Permission
     * Excluded columns:
     */
    public Collection getBeans_inForum(int forumID)
        throws DatabaseException {

        Connection connection = null;
        PreparedStatement statement = null;
        ResultSet resultSet = null;
        Collection retValue = new ArrayList();

        StringBuffer sql = new StringBuffer(512);
        sql.append("SELECT MemberID, ForumID, Permission");
        sql.append(" FROM " + TABLE_NAME);
        sql.append(" WHERE ForumID = ?");
        sql.append(" ORDER BY MemberID ");

        try {
            connection = DBUtils.getConnection();
            statement = connection.prepareStatement(sql.toString());
            statement.setInt(1, forumID);
            resultSet = statement.executeQuery();
            while (resultSet.next()) {
                MemberForumBean bean = new MemberForumBean();
                bean.setMemberID(resultSet.getInt("MemberID"));
                bean.setForumID(resultSet.getInt("ForumID"));
                bean.setPermission(resultSet.getInt("Permission"));
                retValue.add(bean);
            }
            return retValue;
        } catch (SQLException sqle) {
            log.error("Sql Execution Error!", sqle);
            throw new DatabaseException("Error executing SQL in MemberForumDAOImplJDBC.getBeans_inForum.");
        } finally {
            DBUtils.closeResultSet(resultSet);
            DBUtils.closeStatement(statement);
            DBUtils.closeConnection(connection);
        }
    }
}// end of class MemberForumDAOImplJDBC

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产清纯在线一区二区www| 在线观看网站黄不卡| 亚洲黄色小说网站| 久久这里只有精品6| 色综合一区二区| 国产在线视频一区二区三区| 一区二区三区免费观看| 精品国产乱码久久久久久闺蜜| 在线视频你懂得一区二区三区| 黑人巨大精品欧美一区| 午夜激情一区二区三区| 国产精品久久福利| www久久精品| 日韩欧美中文字幕一区| 在线观看日韩电影| 99精品欧美一区| 国产精品自在欧美一区| 麻豆freexxxx性91精品| 亚洲国产精品嫩草影院| 亚洲女与黑人做爰| 综合在线观看色| 国产视频视频一区| 久久尤物电影视频在线观看| 欧美高清你懂得| 欧美日韩一区在线| 91黄色小视频| 91蜜桃在线观看| 成人avav影音| 成人免费视频一区| 成人h动漫精品一区二区| 国产麻豆视频一区二区| 久久99国产精品免费| 奇米四色…亚洲| 日本成人在线网站| 石原莉奈一区二区三区在线观看 | 精品视频一区二区不卡| www.av亚洲| 成a人片亚洲日本久久| 国产成人av资源| 风间由美一区二区三区在线观看| 国内成人免费视频| 国产乱子伦一区二区三区国色天香| 久久狠狠亚洲综合| 久久69国产一区二区蜜臀| 久久99热99| 国产一区二区久久| 成人午夜私人影院| av在线不卡网| 欧美视频在线播放| 欧美高清视频www夜色资源网| 555夜色666亚洲国产免| 日韩免费在线观看| 亚洲精品在线一区二区| 国产片一区二区| 国产精品盗摄一区二区三区| 一区在线观看免费| 一区二区三区国产精华| 亚洲成人免费av| 日韩成人午夜精品| 精品一二线国产| 成人h精品动漫一区二区三区| 91在线看国产| 精品视频一区二区不卡| 欧美一级精品大片| 国产无遮挡一区二区三区毛片日本| 欧美高清一级片在线观看| 一区二区三区在线视频观看 | 久久久亚洲精品一区二区三区| 国产区在线观看成人精品| 亚洲欧美aⅴ...| 免费人成黄页网站在线一区二区 | 日本伦理一区二区| 91精品国产乱码久久蜜臀| 2021国产精品久久精品| 国产精品色在线| 午夜欧美视频在线观看| 国产在线视频不卡二| 99热99精品| 欧美一级日韩一级| 国产精品污污网站在线观看| 亚洲动漫第一页| 国产精品一区二区在线观看不卡 | 日韩一级在线观看| 国产欧美精品区一区二区三区| 一区二区三区不卡视频| 久久99久久久欧美国产| 91久久一区二区| 精品国产免费人成在线观看| 国产精品家庭影院| 日本不卡高清视频| 99re6这里只有精品视频在线观看| 欧美日本韩国一区| 国产精品不卡一区二区三区| 理论电影国产精品| 欧美专区日韩专区| 欧美国产激情二区三区| 天天影视色香欲综合网老头| 成年人国产精品| 久久综合色之久久综合| 午夜精品一区二区三区电影天堂| 国产99久久久国产精品潘金网站| 欧美色图一区二区三区| 中文欧美字幕免费| 久久国产麻豆精品| 欧美视频一区二区三区四区 | 精品成人私密视频| 亚洲一区二区黄色| 99久久99久久综合| 久久久久亚洲蜜桃| 美女视频黄 久久| 欧美日韩综合色| 亚洲精品精品亚洲| 成人av影院在线| 久久精品日产第一区二区三区高清版| 丝袜美腿高跟呻吟高潮一区| 日本韩国精品在线| 国产精品国产精品国产专区不片| 韩国一区二区在线观看| 欧美一区二区久久| 五月婷婷久久综合| 在线视频国内自拍亚洲视频| 亚洲伦理在线免费看| aaa亚洲精品| 国产精品国产a级| 成熟亚洲日本毛茸茸凸凹| 久久蜜桃一区二区| 国内外成人在线| 欧美精品一区二区不卡| 毛片基地黄久久久久久天堂| 91.com在线观看| 日韩黄色在线观看| 在线不卡免费欧美| 日韩精品高清不卡| 日韩亚洲电影在线| 久久99国产精品久久| 日韩欧美一区电影| 精品制服美女丁香| 精品久久久久久最新网址| 久久av资源网| 久久久久久亚洲综合影院红桃 | 国产麻豆成人精品| 久久久精品中文字幕麻豆发布| 久久99热这里只有精品| 2023国产一二三区日本精品2022| 韩国成人在线视频| 亚洲国产高清aⅴ视频| av一区二区三区在线| 亚洲人成精品久久久久| 欧美在线观看视频一区二区| 亚洲va国产va欧美va观看| 91精品国产高清一区二区三区蜜臀| 裸体健美xxxx欧美裸体表演| 精品久久一二三区| a亚洲天堂av| 亚洲国产精品久久不卡毛片 | 91精品国产色综合久久久蜜香臀| 日本视频中文字幕一区二区三区| 日韩欧美色综合| 国产成人免费网站| 亚洲色图欧洲色图| 欧美日产国产精品| 国产丶欧美丶日本不卡视频| 亚洲精品视频观看| 91精品在线麻豆| 成人永久aaa| 亚洲国产一二三| 久久女同性恋中文字幕| 色婷婷久久99综合精品jk白丝| 亚洲高清久久久| 久久亚洲一级片| 日本韩国一区二区三区视频| 久久精品免费观看| 一区在线观看视频| 日韩欧美国产系列| 99久久国产综合精品色伊| 日韩av在线播放中文字幕| 国产亚洲精品bt天堂精选| 91久久精品国产91性色tv| 美日韩黄色大片| 亚洲激情图片qvod| 久久久久久电影| 欧美性生活影院| 风间由美一区二区三区在线观看 | 日本va欧美va瓶| 国产精品久久久久影院亚瑟| 91精品国产美女浴室洗澡无遮挡| 成人97人人超碰人人99| 蜜臀av性久久久久蜜臀aⅴ四虎 | 日韩一区二区在线免费观看| 成人动漫精品一区二区| 久久精品国产亚洲高清剧情介绍| 国产精品久久毛片av大全日韩| 欧美精品久久久久久久多人混战 | 久热成人在线视频| 亚洲综合在线电影| 亚洲国产精品激情在线观看| 日韩午夜激情免费电影| 色素色在线综合| 成人精品免费视频| 精品一区二区在线观看|