execute的返回值是boolean类型
看是true还是false就可以了
executeUpdate返回值是int,代表受影响的行数
为0不成功

解决方案 »

  1.   

    catch SQLException报出错信息!
      

  2.   

    不错!
    可以看JDK DOC,里面说的很详细
      

  3.   

    For 'execute': return boolean value
    true if the first result is a ResultSet object; false if it is an update count or there are no results .For 'executeUpdate': return int value
    either the row count for INSERT, UPDATE or DELETE statements, or 0 for SQL statements that return nothing