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

📄 operuseraccount.java

📁 电信的网厅的整站代码
💻 JAVA
字号:
package com.doone.fj1w.fjmgr.useroperinfo;
import com.doone.data.DacClient;
import com.doone.data.DataTable;
import com.doone.util.FileLogger;
/**
 * <p>Title: </p>
 *
 * <p>Description: </p>
 *
 * <p>Copyright: Copyright (c) 2005</p>
 *
 * <p>Company: </p>
 *
 * @author not attributable
 * @version 1.0
 */

public class Operuseraccount {

    private String sueraccountid=null;
    private String sbillid=null;
    private String saccountcode=null;
    private String smoney=null;

    private DacClient _dbClient=null;
    private int pageSize=20;//每页记录数
    private int rowCount=0;//查询数据库中的记录数
    private int pageCount=0;//页数


    public Operuseraccount() {
        try {
          _dbClient = new DacClient();
        }
        catch (Exception ex) {
          FileLogger.getLogger().error(ex);
    }
    }

    public void setuseraccountid(String sueraccountid)
    {this.sueraccountid=sueraccountid;}
    public void setbillid(String sbillid)
    {this.sbillid =sbillid;}
    public void setaccountcode(String saccountcode)
    {this.saccountcode=saccountcode; }
    public void setmoney(String smoney)
    {this.smoney=smoney;}

    public int insertuseraccount(){
        int doExp = 0;
        try {
                // XXX 进行sao中字段的有效性检查。
              String Sql_Ins_Showinfo = "INSERT INTO Tf_UserAccount(USERACCOUNTID, BILLID, ACCOUNTCODE, MONEY) VALUES(SEQ_USERACCOUNTID.nextval,?,?,?)";
              Object[] value = new Object[3];
              value[0] = sbillid; //地市编码
              value[1] = saccountcode; //信息名称
              value[2] = smoney;//信息内容

              _dbClient.beginTransaction(10000);
              doExp = _dbClient.executeUpdate(Sql_Ins_Showinfo,1000,value);
              _dbClient.endTransaction(true);

        }catch (Exception ex) {
            FileLogger.getLogger().error(ex);
            try{_dbClient.endTransaction(false);}
             catch(Exception ex1){}
        }
        return doExp;
    }

    public int deleteuseraccount(String tablename,String id){
        int doExp = 0;
        try {
                // XXX 进行sao中字段的有效性检查。
              String Sql_Del_Showinfo = "delete from "+tablename+" where "+id+"=?";
              Object[] value = new Object[1];
              value[0] = sueraccountid; //序号

              _dbClient.beginTransaction(10000);
              doExp = _dbClient.executeUpdate(Sql_Del_Showinfo,1000,value);
              _dbClient.endTransaction(true);

        }catch (Exception ex) {
            FileLogger.getLogger().error(ex);
            try{_dbClient.endTransaction(false);}
             catch(Exception ex1){}
        }
        return doExp;
    }

    public int updateuseraccount(){
        int doExp = 0;
        try {
                // XXX 进行sao中字段的有效性检查。
              String Sql_Upd_Showinfo = "update Tf_UserAccount set BILLID=?, ACCOUNTCODE=?, MONEY=?  where USERACCOUNTID=?";
              Object[] value = new Object[4];
              value[0] = sbillid; //
              value[1] = saccountcode; //地市编码
              value[2] = smoney; //信息名称 信息内容
              value[3] = sueraccountid; //序号

              _dbClient.beginTransaction(10000);
              doExp = _dbClient.executeUpdate(Sql_Upd_Showinfo,1000,value);
              _dbClient.endTransaction(true);

        }catch (Exception ex) {
            FileLogger.getLogger().error(ex);
            try{_dbClient.endTransaction(false);}
             catch(Exception ex1){}
        }
        return doExp;
    }

    public DataTable queryuseraccount(String tablename){
        DataTable dt = null;
        try {
            String S_SELECT_TICKET =
                    "select a.*,b.ACCOUNTNAME from "+tablename+" a,Ts_ConfigAccount b where 1=? and a.ACCOUNTCODE=b.ACCOUNTCODE";
            Object[] obbb = new Object[1];
            obbb[0] = "1";

            _dbClient.beginTransaction(10000);
            dt = _dbClient.executeQuery(S_SELECT_TICKET, obbb);
            _dbClient.endTransaction(true);

        } catch (Exception ex) {
          FileLogger.getLogger().error(ex);
          try{_dbClient.endTransaction(false);}
             catch(Exception ex1){}
        }
        return dt;
    }

    public String qryexistuseraccount(String tablename,String field1,String field2){
        String doExp = "0";
        try {
            String S_SELECT_TICKET =
                    "select count(*) from "+tablename+" where 1=? and "+field1+"=? and "+field2+"=?";
            Object[] obbb = new Object[3];
            obbb[0] = "1";
            obbb[1] = sbillid;
            obbb[2] = saccountcode;

            _dbClient.beginTransaction(10000);
            doExp = _dbClient.getStringFromSqlQuery(S_SELECT_TICKET, obbb);
            _dbClient.endTransaction(true);

        } catch (Exception ex) {
          FileLogger.getLogger().error(ex);
          try{_dbClient.endTransaction(false);}
             catch(Exception ex1){}
        }
        return doExp;
    }

    //获得页数       参数:表名
       public int getPageCount(String tablename){

         DataTable dt=null;
         try{
           String str = "select count(*) count from "+tablename ;
           _dbClient.beginTransaction(10000);
           dt=_dbClient.executeQuery(str);
           rowCount=dt.getRow(0).getInt("count");
           if (rowCount % pageSize == 0)
               pageCount = rowCount / pageSize;
           else
               pageCount = rowCount / pageSize + 1;

           _dbClient.endTransaction(true);
         }
         catch(Exception ex){
           FileLogger.getLogger().error(ex);
             try{_dbClient.endTransaction(false);}
             catch(Exception ex1){}
         }
         return pageCount;
   }
}

⌨️ 快捷键说明

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