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

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

?? membergroupdaoimpljdbc.java

?? 解觖java技術中后臺無法上傳數給的情況
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
/*
 * $Header: /cvsroot/mvnforum/mvnforum/src/com/mvnforum/db/jdbc/MemberGroupDAOImplJDBC.java,v 1.13 2006/04/14 17:05:26 minhnn Exp $
 * $Author: minhnn $
 * $Revision: 1.13 $
 * $Date: 2006/04/14 17:05:26 $
 *
 * ====================================================================
 *
 * Copyright (C) 2002-2006 by MyVietnam.net
 *
 * 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 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.
 *
 * 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 at MyVietnam net
 *
 * @author: Minh Nguyen  
 * @author: Mai  Nguyen  
 */
package com.mvnforum.db.jdbc;

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

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

public class MemberGroupDAOImplJDBC implements MemberGroupDAO {

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

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

    public MemberGroupDAOImplJDBC() {
    }

    protected static boolean isDirty() {
        return m_dirty;
    }

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

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

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

    public void isTutor(int memberID)
        throws ObjectNotFoundException, DatabaseException {

        Connection connection = null;
        PreparedStatement statement = null;
        ResultSet resultSet = null;
        StringBuffer sql = new StringBuffer(512);

        sql.append(" SELECT * FROM " + TABLE_NAME + " membergroup , " + GroupsDAO.TABLE_NAME + " groups ");
        sql.append(" WHERE membergroup.GroupID = groups.GroupID");
        sql.append(" AND membergroup.MemberID = ?");
        sql.append(" AND groups.GroupName = ?");
        try {
            connection = DBUtils.getConnection();
            statement = connection.prepareStatement(sql.toString());
            statement.setInt(1, memberID);
            statement.setString(2, GroupsDAO.TUTOR_GROUP_NAME);
            resultSet = statement.executeQuery();
            if (!resultSet.next()) {
                throw new ObjectNotFoundException("Cannot find the primary key (" + memberID + ") in table 'MemberGroup'.");
            }
        } catch(SQLException sqle) {
            log.error("Sql Execution Error!", sqle);
            throw new DatabaseException("Error executing SQL in MemberGroupDAOImplJDBC.isTutor.");
        } finally {
            DBUtils.closeResultSet(resultSet);
            DBUtils.closeStatement(statement);
            DBUtils.closeConnection(connection);
        }
    }

    /*
     * Included columns: GroupID, MemberID, MemberName, Privilege, CreationDate,
     *                   ModifiedDate
     * Excluded columns:
     */
    public void create(int groupID, String memberName,
                       int privilege, Timestamp creationDate, Timestamp modifiedDate)
        throws CreateException, DatabaseException, DuplicateKeyException, ForeignKeyNotFoundException {

        int 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().findByAlternateKey_MemberName(memberName);//redundant ???
            memberID = DAOFactory.getMemberDAO().getMemberIDFromMemberName(memberName);
        } catch(ObjectNotFoundException e) {
            throw new ForeignKeyNotFoundException("Foreign key refers to table 'Member' does not exist. Cannot create new MemberGroup.");
        }

        // @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_increament column, then you can safely delete this block
        try {
            //Check if primary key already exists
            findByPrimaryKey(groupID, memberID);
            //If so, then we have to throw an exception
            throw new DuplicateKeyException("Primary key already exists. Cannot create new MemberGroup with the same [GroupID, MemberID] (" + groupID + ", " + memberID + ").");
        } catch(ObjectNotFoundException e) {
            //Otherwise we can go ahead
        }

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

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

            statement.setInt(1, groupID);
            statement.setInt(2, memberID);
            statement.setString(3, memberName);
            statement.setInt(4, privilege);
            statement.setTimestamp(5, creationDate);
            statement.setTimestamp(6, modifiedDate);

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

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

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品伊人久久久久7777人| 高清不卡一区二区| 三级欧美在线一区| 一区二区三区精品| 视频一区二区三区在线| 日韩黄色在线观看| 久久久国际精品| 欧美久久一区二区| 91啦中文在线观看| 国产精品99久久久久| 91麻豆123| 日韩欧美一二区| 欧美激情艳妇裸体舞| 亚洲女爱视频在线| 日本va欧美va欧美va精品| 成人综合在线视频| 91精品欧美综合在线观看最新 | 免费观看成人鲁鲁鲁鲁鲁视频| 国产米奇在线777精品观看| 91久久精品日日躁夜夜躁欧美| 日韩高清欧美激情| 国产精品亚洲专一区二区三区| 91麻豆免费视频| 日韩欧美一级片| 国产精品黄色在线观看| 日韩不卡手机在线v区| 高清不卡一二三区| 亚洲精品一区二区三区四区高清| 国产精品妹子av| 日本女优在线视频一区二区| 国产999精品久久| 9191成人精品久久| 中文字幕av一区二区三区| 午夜精品福利一区二区三区av| www.欧美色图| 日本一区二区免费在线观看视频| 日本美女一区二区三区视频| 色老综合老女人久久久| 国产精品成人一区二区艾草 | 亚洲欧美日韩国产综合| 久久精品一区八戒影视| 激情小说欧美图片| 欧美色男人天堂| 亚洲欧洲一区二区三区| www.欧美日韩| 一个色妞综合视频在线观看| 91麻豆精品一区二区三区| 国产欧美一区二区精品秋霞影院 | 国产精品色哟哟网站| 成人激情综合网站| 一色屋精品亚洲香蕉网站| 99久久99久久综合| 日韩理论片网站| 972aa.com艺术欧美| 樱桃国产成人精品视频| 欧美色图在线观看| 亚洲综合久久av| 欧美一区二区三区不卡| 久久精品国产在热久久| 日韩天堂在线观看| 国产在线一区二区| 综合久久久久久久| 欧美三区在线观看| 蜜桃视频在线观看一区| 久久综合久久综合久久综合| 高清不卡在线观看av| 自拍偷拍欧美精品| 欧洲精品一区二区| 亚洲电影在线播放| 一本大道久久a久久综合| 亚洲品质自拍视频| 91精品久久久久久蜜臀| 国模无码大尺度一区二区三区| 国产精品色一区二区三区| 69av一区二区三区| av电影在线观看不卡| 日本一道高清亚洲日美韩| 精品电影一区二区| 91福利视频网站| 成人久久视频在线观看| 日韩欧美二区三区| 久久久久久久综合色一本| 韩国成人在线视频| 午夜av区久久| 亚洲一区二区三区精品在线| 国产日韩精品一区| 欧美精品一卡二卡| 91热门视频在线观看| 美女看a上一区| 视频一区二区三区中文字幕| 综合激情成人伊人| 2021中文字幕一区亚洲| 中文字幕一区二区在线观看| 一区二区三区欧美久久| 国产自产高清不卡| 五月婷婷激情综合网| 一区二区三区在线免费| 国产精品久久久久久久蜜臀 | 午夜久久福利影院| 自拍偷拍亚洲综合| 亚洲日本在线视频观看| 精品黑人一区二区三区久久| 欧美老肥妇做.爰bbww| 一本一本久久a久久精品综合麻豆| 成人免费高清视频在线观看| 精品一区二区三区视频在线观看| 亚洲www啪成人一区二区麻豆| 亚洲人成伊人成综合网小说| 国产精品色呦呦| 中文字幕一区二区日韩精品绯色| 亚洲欧美日韩一区| 一二三区精品视频| 亚洲成a人v欧美综合天堂下载| 亚洲精品视频在线| 日韩一区精品视频| 国产一区二区主播在线| 国产又粗又猛又爽又黄91精品| 麻豆成人av在线| 正在播放亚洲一区| 国产白丝网站精品污在线入口| 欧美精品久久久久久久久老牛影院| 五月婷婷色综合| 激情综合网最新| 国产成人av电影| 在线视频亚洲一区| 欧美日韩在线三级| 日韩欧美成人一区二区| 亚洲欧洲精品天堂一级| 石原莉奈在线亚洲三区| 国产一区二区三区精品欧美日韩一区二区三区 | 久久er精品视频| 91老司机福利 在线| 精品国产乱码久久久久久久| 欧美在线免费播放| 色综合久久六月婷婷中文字幕| 免费人成网站在线观看欧美高清| 日韩高清在线电影| 日本二三区不卡| 欧美成人a∨高清免费观看| 亚洲影视在线观看| 国产.精品.日韩.另类.中文.在线.播放| 欧美色网站导航| 亚洲乱码精品一二三四区日韩在线| 麻豆国产精品777777在线| 日本中文字幕不卡| 免费成人在线播放| 色综合久久久久网| 欧美精品一区二区三区四区 | 色综合婷婷久久| 久久精品欧美日韩精品| 日本成人在线视频网站| 欧美性视频一区二区三区| 最新国产精品久久精品| 国产精品99精品久久免费| 欧美一区二区三区四区在线观看| 国产午夜精品福利| 亚洲第一主播视频| 欧美在线免费视屏| 亚洲综合丁香婷婷六月香| 欧美专区日韩专区| 亚洲bt欧美bt精品777| 欧美巨大另类极品videosbest | 国产精品每日更新| 蜜臀久久久久久久| 精品国产欧美一区二区| 精品一区二区av| 日本一区二区三区高清不卡| 国产精品12区| 国产精品盗摄一区二区三区| 9久草视频在线视频精品| 亚洲综合在线电影| 91精品婷婷国产综合久久竹菊| 六月丁香婷婷久久| 国产无一区二区| 在线观看国产一区二区| 日韩av在线发布| 蜜臀va亚洲va欧美va天堂| 东方aⅴ免费观看久久av| 日韩一区二区三区四区| 美女脱光内衣内裤视频久久影院| 26uuu色噜噜精品一区| 99精品国产视频| 日韩高清中文字幕一区| 国产精品毛片久久久久久久| 91精品午夜视频| 97久久精品人人做人人爽50路| 日韩高清在线一区| 亚洲一区二区三区自拍| 国产欧美一区二区精品秋霞影院| 欧美人狂配大交3d怪物一区| 成人免费毛片app| 久久精品国产久精国产| 一区二区三区精品久久久| 国产超碰在线一区| 日本麻豆一区二区三区视频| 色综合天天综合网天天看片| av高清不卡在线| 国内精品免费**视频| 奇米四色…亚洲| 亚洲一区二区视频在线观看|