首页 > 其他 > 详细

java 调存储过程

时间:2014-03-06 08:37:44      阅读:405      评论:0      收藏:0      [点我收藏+]


String sql = "{call INIT_SORT()}";
     
     CallableStatement cs = null;
        Connection conn = null;
        ResultSet rs = null;
     try {
            conn = SessionFactoryUtils.getDataSource(getSessionFactory())
                    .getConnection();

            conn.commit();
            conn.setAutoCommit(true);

            cs = conn.prepareCall(sql);
            cs.execute();
     } catch (SQLException e) {
            e.printStackTrace();
        } finally {
            try {
                if (null != rs) {
                    rs.close();
                }
                if (null != cs) {
                    cs.close();
                }
                if (null != conn) {
                    conn.close();
                }
            } catch (SQLException e) {
                e.printStackTrace();
            }
        }   

java 调存储过程,布布扣,bubuko.com

java 调存储过程

原文:http://blog.csdn.net/fokle/article/details/20580245

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!