Is there any way to stop or terminate long running Oracle query in JDBC ? It often end up with restart application server to get jdbc to disconnect from Oracle DB.
Looking for functionality similar to SQL Plus – Kill session in Java or JDBC
in SQL Plus
SQL> ALTER SYSTEM KILL SESSION 'sid,serial#';
any clue to perform in java ?
Possibly bit off, but I would propose using JDBC Timeout instead. It has the added benefit of actually terminating gracefully instead of by force.
With modern app servers you can usually define JDBC timeout from datasource configuration.