还真没想过这两个的区别,关注ing

解决方案 »

  1.   

    boolean execute(String sql) 
              Executes the given SQL statement, which may return multiple results. 
     int executeUpdate(String sql) 
              Executes the given SQL statement, which may be an INSERT, UPDATE, or DELETE statement or an SQL statement that returns nothing, such as an SQL DDL statement.
      

  2.   

    commit是在存储过程中做的。
    那么在执行存储过程的时候应该是用execute而不是executeUpdate?
    如果用executeUpdate有什么后果吗?