且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在Java/JDBC中取消Postgres查询

更新时间:2022-12-17 15:08:51

调用java.sql.PreparedStatement.cancel()方法.检查postgres JDBC驱动程序是否支持此方法.据我从最新的postgres JDBC驱动程序的源代码中看到的,它确实停止了查询.

Call java.sql.PreparedStatement.cancel() method. Check whether postgres JDBC driver supports this method. As far as I can see from the source code of the latest postgres JDBC driver it does stop the query.