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

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

?? memberpermissiondaoimpljdbc.java

?? java servlet著名論壇源代碼
?? JAVA
字號:
/*
 * $Header: /cvsroot/mvnforum/mvnforum/src/com/mvnforum/db/jdbc/MemberPermissionDAOImplJDBC.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 MemberPermissionDAOImplJDBC implements MemberPermissionDAO {

    private static Log log = LogFactory.getLog(MemberPermissionDAOImplJDBC.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 MemberPermissionDAOImplJDBC() {
    }

    protected static boolean isDirty() {
        return m_dirty;
    }

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

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

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

    /*
     * Included columns: MemberID, Permission
     * Excluded columns:
     */
    public void create(int memberID, 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, permission);
            //If so, then we have to throw an exception
            throw new DuplicateKeyException(
                "Primary key already exists. Cannot create new MemberPermission with the same <MemberID, Permission> (" + memberID + ", " +
                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 MemberPermission.");
            }
        }

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

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

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

    public void delete(int memberID, 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 Permission = ?");

        try {
            connection = DBUtils.getConnection();
            statement = connection.prepareStatement(sql.toString());
            statement.setInt(1, memberID);
            statement.setInt(2, permission);
            if (statement.executeUpdate() != 1) {
                throw new ObjectNotFoundException("Cannot delete a row in table MemberPermission where primary key = (" + memberID + ", " +
                                                  permission + ").");
            }
            m_dirty = true;
        } catch (SQLException sqle) {
            log.error("Sql Execution Error!", sqle);
            throw new DatabaseException("Error executing SQL in MemberPermissionDAOImplJDBC.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 MemberPermissionDAOImplJDBC.delete_inMember.");
        } finally {
            DBUtils.closeStatement(statement);
            DBUtils.closeConnection(connection);
        }
    }

    /*
     * Included columns: MemberID, 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 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()) {
                MemberPermissionBean bean = new MemberPermissionBean();
                bean.setMemberID(memberID);
                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 MemberPermissionDAOImplJDBC.getBeans_inMember.");
        } finally {
            DBUtils.closeResultSet(resultSet);
            DBUtils.closeStatement(statement);
            DBUtils.closeConnection(connection);
        }
    }

} // end of class MemberPermissionDAOImplJDBC

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品国产免费一区二区三区香蕉 | 久久久不卡网国产精品二区| 国产一区免费电影| 久久久精品国产免费观看同学| 日韩一区精品视频| 欧美国产日韩亚洲一区| 欧美在线一二三四区| 国产成人8x视频一区二区| 欧美国产精品一区二区三区| 欧美系列亚洲系列| 国产一区二区三区美女| 亚洲日本护士毛茸茸| 日韩免费观看高清完整版| 国产精一区二区三区| 日本亚洲视频在线| 久久午夜羞羞影院免费观看| 欧美性受xxxx| 欧美日韩亚洲国产综合| a4yy欧美一区二区三区| 亚洲福利电影网| 日韩三级免费观看| 日韩午夜三级在线| 欧美日产在线观看| 欧洲视频一区二区| 国产精品亚洲专一区二区三区| 美日韩黄色大片| 日韩精品视频网| 喷水一区二区三区| 三级久久三级久久| 另类的小说在线视频另类成人小视频在线| 欧美经典三级视频一区二区三区| 国产成人在线视频网站| 国产一区在线观看麻豆| 国产在线一区二区| 成人高清视频在线| 亚洲电影一区二区三区| 午夜视频在线观看一区二区| 一区二区三区在线视频观看58| 一区二区三区精品在线观看| 久久久99免费| 久久综合久久综合久久综合| www.成人在线| 日本韩国欧美三级| 91精品视频网| 久久精品一区二区| 国产精品色噜噜| 国产精品香蕉一区二区三区| 日韩成人免费在线| 18欧美亚洲精品| 一区二区三区精品| 另类的小说在线视频另类成人小视频在线| 轻轻草成人在线| 国内精品久久久久影院一蜜桃| 国产精品综合一区二区三区| 国产成人高清在线| 91免费小视频| 91麻豆精品国产自产在线 | 中文无字幕一区二区三区| 久久亚洲精华国产精华液| 国产欧美一区二区精品婷婷| 1024国产精品| 五月天视频一区| 国产激情视频一区二区在线观看| 91国偷自产一区二区开放时间| 在线不卡免费av| 久久综合久久综合久久综合| 亚洲欧美国产77777| 五月婷婷久久丁香| 亚洲成av人片在www色猫咪| 久久草av在线| 狠狠色丁香九九婷婷综合五月| 国产一区二区中文字幕| 精品国产一区久久| 精品夜夜嗨av一区二区三区| 精品国产三级a在线观看| 久久99精品国产.久久久久| 精品久久一区二区三区| 黄页视频在线91| 久久久久久免费| 丰满亚洲少妇av| 日韩毛片精品高清免费| 色呦呦网站一区| 亚洲成国产人片在线观看| 欧美日韩成人综合| 另类人妖一区二区av| 欧美精品一区二区三区蜜臀| 亚洲精品免费电影| 粉嫩aⅴ一区二区三区四区五区| 国产日韩在线不卡| 91在线精品一区二区| 亚洲国产精品久久人人爱蜜臀| 欧美男同性恋视频网站| 免费高清在线一区| 国产精品视频麻豆| 欧美乱熟臀69xxxxxx| 蜜臀av一区二区在线免费观看 | 日韩精品一区二区三区蜜臀| 久久成人免费电影| 中文字幕一区二区三区在线观看| 91女人视频在线观看| 日韩高清在线不卡| 国产欧美精品国产国产专区| 91日韩在线专区| 奇米色一区二区三区四区| 久久久影院官网| 日本久久电影网| 狠狠色丁香久久婷婷综| 日韩毛片在线免费观看| 日韩女优毛片在线| 91污在线观看| 狠狠色丁香婷婷综合久久片| 一区二区三区蜜桃| 久久久久久久久久久久久久久99 | 日本欧美肥老太交大片| 日本一二三不卡| 欧美一区二区性放荡片| 91影院在线免费观看| 美女视频黄频大全不卡视频在线播放| 国产精品久线观看视频| 日韩欧美美女一区二区三区| 91在线视频观看| 久久精品国产免费| 一区二区三区精品在线观看| 久久亚洲综合色| 日韩欧美一级二级三级久久久| 日本道色综合久久| 国产凹凸在线观看一区二区| 全部av―极品视觉盛宴亚洲| 亚洲最新视频在线观看| 亚洲欧洲美洲综合色网| 国产调教视频一区| 精品久久久久久久久久久久包黑料 | 偷拍自拍另类欧美| 一区二区理论电影在线观看| 亚洲国产精品成人综合 | 亚洲色图欧洲色图| 中文字幕va一区二区三区| 欧美一级欧美一级在线播放| 在线这里只有精品| 91同城在线观看| 99久久免费精品高清特色大片| 国产综合色精品一区二区三区| 欧美日韩在线综合| 色噜噜夜夜夜综合网| 97se狠狠狠综合亚洲狠狠| 不卡在线观看av| 成人av网在线| aaa亚洲精品| 97超碰欧美中文字幕| 99视频精品免费视频| 91丨九色丨蝌蚪富婆spa| 菠萝蜜视频在线观看一区| 国产成人亚洲综合色影视| 国产成人小视频| 成人理论电影网| 色综合一个色综合| 欧美日精品一区视频| 欧美美女网站色| 制服丝袜成人动漫| 欧美一二三四在线| www日韩大片| 欧美tk—视频vk| 国产日韩精品一区| 中文字幕va一区二区三区| 欧美激情一区二区在线| 国产精品私人影院| 亚洲日本成人在线观看| 亚洲黄色免费网站| 亚洲精品国产一区二区精华液| 亚洲与欧洲av电影| 麻豆成人综合网| av一区二区三区四区| 在线观看国产一区二区| 日韩一级免费观看| 欧美激情自拍偷拍| 亚洲国产成人av网| 国产在线精品一区二区三区不卡| 国产东北露脸精品视频| 欧美剧情电影在线观看完整版免费励志电影| 亚洲欧美一区二区视频| 亚洲线精品一区二区三区八戒| 美女视频黄久久| 一本色道**综合亚洲精品蜜桃冫 | 精品一区二区三区免费播放| 风间由美一区二区三区在线观看| 91啦中文在线观看| 精品少妇一区二区三区免费观看| 中文字幕第一区第二区| 无码av免费一区二区三区试看 | 欧美电影影音先锋| 欧美高清在线一区| 日本欧美一区二区| 91蜜桃在线观看| 精品国产成人系列| 性做久久久久久久免费看| 国产成人免费高清| 欧美tickle裸体挠脚心vk| 亚洲激情网站免费观看| 国产99精品在线观看| 日韩欧美在线一区二区三区|