Last updated on JUNE 02, 2017
Applies to:JDBC - Version 10.2.0.3 to 184.108.40.206.0 [Release 10.2 to 12.1]
Information in this document applies to any platform.
***Checked for relevance on 29-Feb-2016***
This article provides a very simple JDBC standalone program to demonstrate the use of the JDBC standard method setQueryTimeout() which is available for all JDBC java.sql.Statement objects. The article will also discuss limitations that may prevent the setQueryTimeout() from working properly due to limitations of both the database and the JDBC driver.
The Statement.setQueryTimeout(int seconds) relies on the Statement.cancel() method and basically implements a thread to cancel a long running query after a specified delay.
This demonstration builds on <Note 357615.1> How to simulate a slow query. Useful for testing of timeout issues
This program has been tested using RDBMS 10.2.0.3 ( Linux x86 32-bit) JDBC/thin 10.2.0.3, JDBC/thin 220.127.116.11, JDBC/thin 18.104.22.168 and JDK 1.5 / 1.6 ( Windows client)
Sign In with your My Oracle Support account
Don't have a My Oracle Support account? Click to get started
Million Knowledge Articles and hundreds of Community platforms