PreparedStatement的excute返回值的让我疑惑
? 今天用jdbc写了一句sql语句,通过PreparedStatement对象来插入记录,发现一个奇怪的问题,我明明是成功插入记录,可是pstmt.execute()确返回的是false,狂晕中。
String sqlText = "insert into problem(title, " +"description, input, output, sample_input, " +"sample_output, hint, source, uploader) " +"values(?, ?, ?, ?, ?, ?, ?, ?, ?)";PreparedStatement pstmt = null;......res = pstmt.execute();
?
??? 呵呵,感到比较困惑
。查看sun的API后恍然大悟。
???? executeUpdate()返回数据库中更新记录的条数。那哪位大侠出来说一下execute该在什么情况下使用哇?
1 楼 抛出异常的爱 2010-05-10 在执行此PreparedStatement对象的SQL语句,