From f0af538f59924fd9d692627102c94517e5f6008e Mon Sep 17 00:00:00 2001 From: Sehrope Sarkuni Date: Wed, 27 Nov 2019 15:05:20 -0500 Subject: [PATCH] feat: Add cancelQuery() to PGConnection public interface (#1157) Adds cancelQuery() to the extended public interface PGConnection to allow for issueing of cancels directly to connections rather than having to keep track of individual statements. The internals of the driver and the backend server already operate at a connection level (not a statement level) and this patch only exposes the existing cancelQuery() method publicly. --- pgjdbc/src/main/java/org/postgresql/PGConnection.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pgjdbc/src/main/java/org/postgresql/PGConnection.java b/pgjdbc/src/main/java/org/postgresql/PGConnection.java index fd764563fb..f48d22fb32 100644 --- a/pgjdbc/src/main/java/org/postgresql/PGConnection.java +++ b/pgjdbc/src/main/java/org/postgresql/PGConnection.java @@ -184,6 +184,11 @@ public interface PGConnection { */ int getBackendPID(); + /** + * Sends a query cancellation for this connection. + */ + void cancelQuery() throws SQLException; + /** * Return the given string suitably quoted to be used as an identifier in an SQL statement string. * Quotes are added only if necessary (i.e., if the string contains non-identifier characters or