This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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: 3697
    
    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: 3697
    
    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
 
Similar Threads
some doubts regarding hybernate,DB2.
Calling DB2 stored procedures
querytimeout not working
Not able to read ResultSet from as400 stored procedure
Packed decimal conversion - Java