Java – stop or terminate long-running queries in JDBC

Is there any way to stop or terminate long-running Oracle queries in JDBC? It usually ends up restarting the application server to disconnect JDBC from Oracle dB

Look for features similar to SQL plus – kill sessions with Java or JDBC

In SQL plus

sql> ALTER SYstem KILL SESSION 'sid,serial#';

Any clues to execution in Java?

Solution

It may be a little biased, but I suggest using JDBC timeout It has the added benefit of practical elegance rather than forced termination

With modern application servers, you can usually define JDBC timeouts from the data source configuration

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>