⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 clubblackedit.java

📁 GamVan Club v1.1 源代码
💻 JAVA
字号:
/*
 * ClubBlackEdit.java
 * Created on 2005年3月6日, 下午6:11
 */
package com.gamvan.club.user;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.Statement;
import com.gamvan.conn.ConnClub;
public class ClubBlackEdit {
    String message = new String();
    private int userID=0;
    public boolean updateBlackOver(String[] bIDs, int over) throws Exception{
        boolean bea = false;
        ConnClub bridge = new ConnClub();
        Connection con = bridge.getConnection();
        String sqlCommand = new String();
        String bids = "0";
        try{
            Statement sta;
            int i = 0;
            for (i = 0; i < bIDs.length; i++) {
                bids += "," + bIDs[i];
            }  
            sqlCommand = "update GVclubBlackList set blackOver="+ over +" where bID in ("+ bids +")";
            sta = con.createStatement();   
            sta.executeUpdate(sqlCommand);
            sta.close(); 
            bea = true;
        }catch(Exception e){
            con.close();
            message = e.toString();
            bea = false;
        }finally{
            con.close();
        }
        return bea;
    }
    public boolean updateBlackOver(int bID, int over) throws Exception{
        boolean bea = false;
        ConnClub bridge = new ConnClub();
        Connection con = bridge.getConnection();
        String sqlCommand = new String();
        try{
            sqlCommand = "update GVclubBlackList set blackOver=? where bID=?";
            PreparedStatement pps = con.prepareStatement(sqlCommand);
            pps.setInt(1,over);
            pps.setInt(2,bID);
            pps.executeUpdate(sqlCommand);
            pps.close();
            bea = true;
        }catch(Exception e){
            bea = false;
            con.close();
        }finally{
            con.close();
        }
        return bea;
    }   
    public boolean delBlackUser(String[] bIDs) throws Exception{
        boolean bea = false;
        ConnClub bridge = new ConnClub();
        Connection con = bridge.getConnection();
        String sqlCommand = new String();
        String bids = "0";
        try{
            Statement sta;
            int i = 0;
            for (i = 0; i < bIDs.length; i++) {
                bids += "," + bIDs[i];
            }  
            sqlCommand = "delete from  GVclubBlackList where bID in ("+ bids +")";
            sta = con.createStatement();   
            sta.executeUpdate(sqlCommand);
            sta.close();           
        }catch(Exception e){
            message = e.toString();
            bea = false;
            con.close();
        }finally{
            con.close();
        }
        return bea;
    }
    public void delBlackUser(int bID) throws Exception{
        ConnClub bridge = new ConnClub();
        Connection con = bridge.getConnection();
        String sqlCommand = new String();
        try{
            sqlCommand = "delete from GVclubBlackList where bID=?";
            PreparedStatement pps = con.prepareStatement(sqlCommand);
            pps.setInt(1,bID);
            pps.executeUpdate(sqlCommand);
            pps.close();            
        }catch(Exception e){
            con.close();
        }finally{
            con.close();
        }      
    } 
    public String getMessage(){
        return this.message;
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -