`

spring 调用存储过程(简单版)

阅读更多
    public void updateTest(){
        Session session = this.getSession();
        Connection conn = this.getSession().connection();   
        String proc="{call sp_isOrderLock(?,?,?)}"; 
        CallableStatement st;
        int a = 111110;
        try {
            st = conn.prepareCall(proc);
            st.setLong(1,1); 
            st.setLong(2,1); 
            st.setLong(3,1); 
            //st.registerOutParameter(1, a);
            st.executeUpdate(); 
        } catch (SQLException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } 
        System.out.println(a);
        session.reconnect(conn);
        this.releaseSession(session);
    }

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics