How to cancel postgres request in java / JDBC

How to cancel a long posters query through JDBC or Java?

The utility will be that the user starts the query in the postgres database through the front end, but then he decides otherwise and wants to interrupt / cancel the current running query.

+6
java postgresql jdbc
source share
1 answer

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

+4
source share

All Articles