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

📄 licencedaoimpl.java

📁 一套完整的工商12315的源程序jsp部分在12315里,后台JAVA部分在gs12315src里,没有打包数据库.
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
            }
            try {
                this.closeConnection();
            }
            catch (Exception e) {
            }
        }
        return lessincePrintSetList;
    }


    /**
     * 获得变更执照打印时开业需要的sn
     * 应用: 超级查询 查询basisc02
     */
    public String getPracticeSN(String tempChangeSN) throws
        AppException {
        boolean flag = false;
        String practiceSN="";
        String sql = null;
        try {

            conn = Common.getConnection();
            stmt = conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_READ_ONLY);

            //是否正常数据
            if (tempChangeSN == null) {
                Debug.println(
                    "[LicenceDAOImpl]getPracticeSN----->tempSql is null!");
                return practiceSN;
            }

            sql = "select * from "
                + TableNameUtil.GSGSJIN_BASIS02
                + " where field002 like'02%' and field003 in (select field003 from "
                + TableNameUtil.GSGSJOUT_BASIS01
                + " where field001='"
                + tempChangeSN
                + "')"
                ;

            Debug.println("[LicenceDAOImpl]getPracticeSN--->>>count sql:" + sql);
            rs = stmt.executeQuery(sql);
            if(rs.next()){
                practiceSN=rs.getString(1);
            }

            Debug.println("[LicenceDAOImpl]getPracticeSN--->>>practiceSN:"+practiceSN);


        }
        catch (SQLException sqle) {
            Debug.println("[LicenceDAOImpl]getPracticeSN--->>>Exception:" +
                          sqle.getMessage());
        }

        finally {
            try {
                this.closePreparedStatement();
            }
            catch (Exception e) {
            }
            try {
                this.closeResultSet();
            }
            catch (Exception e) {
            }
            try {
                this.closeStatement();
            }
            catch (Exception e) {
            }
            try {
                this.closeConnection();
            }
            catch (Exception e) {
            }
        }
        Debug.println("[LicenceDAOImpl]getPracticeSN--->>>practiceSN:"+practiceSN);
        return practiceSN;
    }

    /**
     * 获得外网SN
     * 参数:内部序号 innerID
     * 应用: 超级查询 查询basisc01
     */
    public ArrayList getRequisitionSN(String innerID,String BID) throws
        AppException {
        boolean flag = false;
        ArrayList requisitionSNList=new ArrayList();
        String sql = null;
        MessageInfoModel messageInfoModel=null;
        try {

            conn = Common.getConnection();
            stmt = conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_READ_ONLY);

            //是否正常数据
            if (innerID==null||BID==null) {
                Debug.println(
                    "[LicenceDAOImpl]getRequisitionSN----->innerID is null!");
                return requisitionSNList;
            }

            sql = "select field001,field002,field003,field004,field005,field007 from "
                + TableNameUtil.GSGSJOUT_BASIS01
                + " where field003='"
                + innerID+"' and field002 like'"
                + BID
                + "%'";

            Debug.println("[LicenceDAOImpl]getRequisitionSN--->>>count sql:" + sql);
            rs = stmt.executeQuery(sql);
            while(rs.next()){
                messageInfoModel=new MessageInfoModel();
                messageInfoModel.setSN(PubFunc.decodeGB(rs.getString("field001"))) ;
                messageInfoModel.setBID(PubFunc.decodeGB(rs.getString("field002"))) ;
                messageInfoModel.setInnerID(PubFunc.decodeGB(rs.getString("field003"))) ;
                messageInfoModel.setYearCheckupYear(PubFunc.decodeGB(rs.getString("field007"))) ;
                requisitionSNList.add(messageInfoModel);
            }

        }
        catch (SQLException sqle) {
            Debug.println("[LicenceDAOImpl]getRequisitionSN--->>>Exception:" +
                          sqle.getMessage());
        }

        finally {
            try {
                this.closePreparedStatement();
            }
            catch (Exception e) {
            }
            try {
                this.closeResultSet();
            }
            catch (Exception e) {
            }
            try {
                this.closeStatement();
            }
            catch (Exception e) {
            }
            try {
                this.closeConnection();
            }
            catch (Exception e) {
            }
        }
        Debug.println("[LicenceDAOImpl]getRequisitionSN--->>>requisitionSNList.size():"+requisitionSNList.size());
        return requisitionSNList;
    }


    /**
     * 获得外网BID
     * 参数:内部序号 innerID
     * 应用: 超级查询 查询basisc01
     */
    public String getRequisitionBID(String innerID,String BID) throws
        AppException {
        boolean flag = false;
        String requisitionBID="";
        String sql = null;
        try {

            conn = Common.getConnection();
            stmt = conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_READ_ONLY);

            //是否正常数据
            if (innerID==null) {
                Debug.println(
                    "[LicenceDAOImpl]getRequisitionBID----->innerID is null!");
                return requisitionBID;
            }

            sql = "select * from "
                + TableNameUtil.GSGSJOUT_BASIS01
                + " where field003='"
                + innerID+"' and field002 like'"
                + BID
                + "%'";


            Debug.println("[LicenceDAOImpl]getRequisitionBID--->>>count sql:" + sql);
            rs = stmt.executeQuery(sql);
            if(rs.next()){
                requisitionBID=rs.getString(2);
            }

            Debug.println("[LicenceDAOImpl]getRequisitionBID--->>>requisitionSN:"+requisitionBID);


        }
        catch (SQLException sqle) {
            Debug.println("[LicenceDAOImpl]getRequisitionBID--->>>Exception:" +
                          sqle.getMessage());
        }

        finally {
            try {
                this.closePreparedStatement();
            }
            catch (Exception e) {
            }
            try {
                this.closeResultSet();
            }
            catch (Exception e) {
            }
            try {
                this.closeStatement();
            }
            catch (Exception e) {
            }
            try {
                this.closeConnection();
            }
            catch (Exception e) {
            }
        }
        Debug.println("[LicenceDAOImpl]getRequisitionBID--->>>requisitionBID:"+requisitionBID);
        return requisitionBID;
    }

    /**
      *Close the PreparedStatement.
      * @param	none
      * @return   none
      * @exception SQLException
      */
     protected void closePreparedStatement() throws AppException {
         try {
             if (pstmt != null) {
                 pstmt.close();
             }
             Debug.print("pstmt已关闭:" + pstmt);
         }
         catch (SQLException sqle) {
             Debug.println(
                 "[LicenceDAOImpl]closeConnection=============SQLException=" + sqle);
             AppException le = new AppException( (Exception) sqle);
             throw le;
         }
     }

     /**
      *Close the Statement.
      * @param	st
      * @return   none
      * @exception SQLException
      */
     protected void closeStatement() throws AppException {
         try {
             if (this.stmt != null) {
                 stmt.close();
             }
         }
         catch (SQLException sqle) {
             Debug.println(
                 "[LicenceDAOImpl]closeConnection=============SQLException=" + sqle);
             AppException le = new AppException( (Exception) sqle);
             throw le;
         }
     }

     /**
      *Close the resultset.
      * @param	st
      * @return   none
      * @exception SQLException
      */
     protected void closeResultSet() throws AppException {
         try {
             if (rs != null) {
                 rs.close();
             }
         }
         catch (SQLException sqle) {
             Debug.println(
                 "[LicenceDAOImpl]closeConnection=============SQLException=" + sqle);
             AppException le = new AppException( (Exception) sqle);
             throw le;
         }
     }

     /**
      *Close the connection.
      * @param	none
      * @return   none
      * @exception SQLException
      */
     protected void closeConnection() throws AppException {
         try {
             if (conn != null && !conn.isClosed()) {
                 conn.close();
             }
             Debug.print("conn已关闭:" + conn);
         }
         catch (SQLException sqle) {
             Debug.println(
                 "[LicenceDAOImpl]closeConnection=============SQLException=" + sqle);
             AppException le = new AppException( (Exception) sqle);
             throw le;
         }
     }

     public static void main(String[] args) {

     }
 }

⌨️ 快捷键说明

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