欢迎投稿

今日深度:

java 调存储过程

java 调存储过程




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();
            }
        }   

www.htsjk.Com true http://www.htsjk.com/shujukunews/629.html NewsArticle java 调存储过程 String sql = {call INIT_SORT()}; CallableStatement cs = null; Connection conn = null; ResultSet rs = null; try { conn = SessionFactoryUtils.getDataSource(getSessionFactory()) .getConnection(); conn.commit(); conn.setAut...
相关文章
    暂无相关文章
评论暂时关闭