CallableStatement proc = null; try {  proc = con.prepareCall("{call YANGJIANP.reran01()}");  boolean flag = proc.execute();  System.out.println(flag);  con.commit(); }catch(Exception e) {
  System.out.println(e.getMessage()); }
像上面那样写,为什么输出的结果是“false”?

解决方案 »

  1.   

    没用过,你查看一下CallableStatement.execute()这个方法的API吧,看看返回false的时候表示什么意思,这样就可以相应的进行修改了。
      

  2.   

    API中是这样写的:如果第一个结果是 ResultSet 对象,则返回 true;如果第一个结果是更新计数或者没有结果,则返回 false
    我的存储过程中实现的是插入和更新操作,不需要返回结果。返回false是不是不对?