java调用存储过程2


import java.sql.CallableStatement;
import java.sql.Connection;

import com.zte.cms.platform.util.db.DBUtil;

public class ConClickThread  implements Runnable{
    //app_fr.PKG_P2P_CONTRACTTRANS. pro_newclick_stat (5, null,  合同id, 用户电脑号);--用于手机合同点击率
    //app_fr.PKG_P2P_CONTRACTTRANS. pro_newclick_stat (22, null,  合同id, 用户电脑号);--用于设备合同点击率
       /**
        * 类型:手机5、设备22、邮件等
        */
       private String statType="";
       /**
        * 合同id
        */
       private String conid="";
       /**
        * 用户电脑号短工号
        */
       private String userno="";
       
        public void run() {                                  // 实现run方法
            insertData();
        }

          public String insertData() {       
                 String strData = null;
                Connection conn = null;
                CallableStatement pstmt = null;                
                try
                {
                    String sql = " {call app_fr.PKG_P2P_CONTRACTTRANS.pro_newclick_stat@CMS_TO_WMS(?,null,?,?) }  ";
                    conn = DBUtil.getConnection();
                    pstmt = conn.prepareCall(sql);
                    pstmt.setString(1, statType);
                    pstmt.setString(2, conid);
                    pstmt.setString(3, userno);
                    pstmt.execute();
                   
                }
                catch (Exception e)
                {
                    e.printStackTrace();
                }
                finally
                {
                    try
                    {
                        
                        if (pstmt != null)
                        {
                            pstmt.close();
                        }
                        if (conn != null)
                        {
                            conn.close();
                        }
                    }
                    catch (Exception e)
                    {
                        e.printStackTrace();
                    }
                }
                return strData;
               }    
        
        
    /**
     * @param args
     */
    public static void main(String[] args) {
        // TODO Auto-generated method stub
//        ConClickThread c=new ConClickThread();
//        c.setConid("1293862");
//        c.setStatType("22");
//        c.setUserno("10044953");
//        Thread t=new Thread(c);
//        t.start();
    }

    public String getConid() {
        return conid;
    }

    public void setConid(String conid) {
        this.conid = conid;
    }

    public String getStatType() {
        return statType;
    }

    public void setStatType(String statType) {
        this.statType = statType;
    }

    public String getUserno() {
        return userno;
    }

    public void setUserno(String userno) {
        this.userno = userno;
    }
    

}
 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值