java调用存储过程例子

    技术2022-05-20  38

    public static void main(String[] args) {     Connection con = null;    try {      Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver").newInstance();      String url =          "jdbc:microsoft:sqlserver://10.52.52.183:1433;DatabaseName=TEST_DB";      String user = "sa";      String password = "11";      Connection conn = DriverManager.getConnection(url, user, password);      conn.setAutoCommit(true);      IProcCall spc =  new ProcCallMssql();      spc.setConnection(conn);      spc.setCallHasResultset(false);      spc.setCallFormat("sp_sync_qm_proc",1);      spc.appendInPara(new Integer(21));

         spc.callProc();      spc.releaseAll();    }    catch (SQLException ex) {             ex.printStackTrace();    }

           catch (Exception ex) {          ex.printStackTrace();    }   }


    最新回复(0)