简体   繁体   中英

JDBC identify getUpdateCount() is update or insert or delete

该语句具有getUpdateCount()方法,但是如何识别它是更新,插入还是删除操作?

You can get the original Statement from the ResultSet by using resultSetInstance.getStatement (), cast it to a PreparedStatement , whose toString() method spits out the original statement as a String . From here, it's just checking the statement itself.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM