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

📄 nszxnew.java

📁 一个建立Oracle序号发生器并调用的小例子程序,其中包含Oracle中序号发生器的建立
💻 JAVA
字号:
package app.controller.internet.nszx;

import frame.llfx.*;
import frame.config.*;
import java.sql.*;
import java.util.*;
//import org.apache.log4j.*;
import frame.log.*;
import app.model.internet.*;
import frame.db.*;
import frame.tran.*;
import frame.action.*;
import frame.logic.*;

/**
 * <p>Title: </p>
 * <p>Description: </p>
 * <p>Copyright: Copyright (c) 2003</p>
 * <p>Company: </p>
 * @author not attributable
 * @version 1.0
 */

public class NszxNew extends BasicTran {
//    static Category cat = Category.getInstance("SsltNew.class.getName()");

    /**
     *
     * 完成主要功能
     * @param 	input Config 从页面的到的打包信息。
     * @return	Config	把需要返回的信息打包返回。
     */
    public static Config execute(Config input) {
//    BasicConfigurator.configure();
//    HttpServletRequest request = null;
//    HttpServletRequest response = null;

        Connection conn=null;
        // 声明所有 T* 类
        TNszx nszxInfo = null;
        Config Nszxcfg = null;

        //定义输出 Config
        Config output = new XMLConfig("szsat", "");
        //    Vector result = null;
        output.addKey("result", "0");
        try {
            Log.init();
            //cat.info("处理启动");
            Nszxcfg = input.getConfig("yj");
            String pZz = nullToEmpty( Nszxcfg.getValue( "zz" ) ); //发言人
            String pSubject = nullToEmpty( Nszxcfg.getValue( "subject" ) ); //主题
            String pLb = nullToEmpty( Nszxcfg.getValue( "lb" ) ); //文章类别
            System.out.println( "文章正文开始"  );
            String pNr = nullToEmpty( Nszxcfg.getValue( "nr" ) ); //文章内容
            System.out.println(pNr);
            System.out.println( "文章正文结束"  );
            String pNsrsbh=nullToEmpty(Nszxcfg.getValue("nsrsbh"));
         //   String pMm=nullToEmpty(Nszxcfg.getValue("mm"));
System.out.println(pZz);
            Connection conn1 = DBConnection.getConnection( Const.IS_INTERNET, Const.IS_AUTOCOMMIT);
/* 注释掉纳税人识别号校验
            String mm="";
            try{
                TWbyh twbyh=new TWbyh(conn1);
                mm=twbyh.getYhmmfromNsrsbh(pNsrsbh);
            }
            catch(DBException e){
                errorExit(output,"纳税人识别号不存在或者密码不匹配!");
            }
            if(!mm.equals(pMm)){
                errorExit(output,"纳税人识别号不存在或者密码不匹配!");
            }
*/

//            Statement stmt = conn1.createStatement();

            Nszx_sjbh nszx_sjbh = new Nszx_sjbh();
            String pSjbh = nszx_sjbh.getSjbh();

//            ResultSet rs = stmt.executeQuery( "select Max( to_number(SJBH ) + 1 ) from NSZX");
//           String pSjbh="";
//            if( rs.next())
//                pSjbh =rs.getString( 1 );//数据编号
//           else
//                pSjbh = "1";

//            if(pSjbh == null || pSjbh.equals(""))
//                pSjbh = "1";

          System.out.println( "数据编号" + pSjbh );
//            rs.close();
//            stmt.close();
//           conn1.close();

            CurrDate currDate = new CurrDate();

            BeanNszx beanNszx=new BeanNszx(pSjbh);
            beanNszx.setBt(pSubject);//标题
            beanNszx.setZxnsr(pZz);//发言人
//clob            beanNszx.setZxzw(pNr);//咨询正文
            beanNszx.setLmbh(pLb);//栏目编号
            beanNszx.setWzgjz(pSubject);//发文关键字
//            beanNszx.setUrl(" ");//发布路径
            beanNszx.setZtbz("02" );//状态标志
            //更新数据库 创建数据库连接
            conn = DBConnection.getConnection( Const.IS_INTERNET, Const.IS_NOT_AUTOCOMMIT);
            beanNszx.insert(conn);



            conn.commit();
//***updateclob
             nszxInfo = new TNszx(conn);
             Hashtable zw_where=new Hashtable();
             zw_where.put("SJBH",pSjbh);
             System.out.println(zw_where);
             nszxInfo.update("zw",pNr,zw_where);
             conn.commit();
//****

        }
        catch (ConfigNotFoundException e) {
            errorExit(output, e.toString());
        }
        catch (DBException e) {
            errorExit(output, conn, e.toString());
        }
        catch (Exception e) {
            errorExit(output, conn, e.toString());
        }
        finally {
            //关闭数据库连接
            try {
                if (conn != null) {
                    conn.close();
                }
            }
            catch (Exception e) {
            }
        }
        System.out.println( "纳税咨询提交"  );
        return output;

    }
}

⌨️ 快捷键说明

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