It's not a secret anymore!*
The moose likes JDBC and the fly likes JDBC to DB2 Mainframe -  query timeout Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "JDBC to DB2 Mainframe -  query timeout" Watch "JDBC to DB2 Mainframe -  query timeout" New topic
Author

JDBC to DB2 Mainframe - query timeout

Mary Jane Sam
Greenhorn

Joined: Jul 15, 2008
Posts: 11
Hello,

I am connecting to DB2 Database in mainframe through DB2 universal type 4 driver and invoke a Stored procedure in DB2 using CallableStatement.

If the stored procedure did not return result within a specific time interval, the process should continue without waiting for the result.

I used setQueryTimeout to set the timeout interval and it does not work for DB2. Is there any way, i can set the timeout?

Thanks..
[ September 11, 2008: Message edited by: Mary Jane Sam ]
Scott Selikoff
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3704
    
    5

Please post a stack trace. Are you sure its not a transaction timeout?


My Blog: Down Home Country Coding with Scott Selikoff
Mary Jane Sam
Greenhorn

Joined: Jul 15, 2008
Posts: 11
There is no stack trace and the execution of Stored procedure continues even after the specified time and no exception is thrown.

How to do we set the transaction timeout?
Scott Selikoff
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3704
    
    5

What server are you using? Its usually set there.
Mary Jane Sam
Greenhorn

Joined: Jul 15, 2008
Posts: 11
Thanks for the response.

I use Websphere server. I tried setting the Total transaction timeout as 1 sec and Maximum lifetime timeout as 2 seconds. Still, the application did not timeout even after the query takes more than 20 seconds.

Is there we can timeout while connecting to DB2 mainframe server when using Db2 universal type 4 driver?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JDBC to DB2 Mainframe - query timeout