由于您正在使用
PreparedStatement,因此可以致电
executeUpdate()-
int count = stmt.executeUpdate(); action = (count > 0); // <-- something like this.
通过上面的Javadoc( Return )链接,添加了重点,
(1) SQL数据操作语言 (DML)语句 的 行数 ,_或者(2)0不返回任何内容的SQL语句 _的 _ 行数_ 。
如果您要插入大量条目,我更喜欢
addBatch()和
executeBatch()。



