aspose file tools*
The moose likes JDBC and the fly likes can the data fetching time be extended? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "can the data fetching time be extended?" Watch "can the data fetching time be extended?" New topic
Author

can the data fetching time be extended?

Padma Prasad
Ranch Hand

Joined: Sep 16, 2002
Posts: 76
Hi,
I am using JDBC 2.0 with datasource and connection pooling. I use Oracle as backend. I am using preparedstatement to fetch some data. There are around 150 rows in the DB but I get the resultset null. when I run the same query in SQL*Plus, its working fine. It's fetching all the rows but taking around 8 mins.(I am connected to the remote DB). but when I connect through my application (JSP -> Java), I get the result set null.
What I doubt is if it is the connection timeout or so to the DB? Can I extend this fetching time? or is something else the problem here?
Jamie Robertson
Ranch Hand

Joined: Jul 09, 2001
Posts: 1879

N:
you can check the time it will take before your connection will timeout by using the PreparedStatement method:
From the API's: getQueryTimeout
public int getQueryTimeout() throws SQLException
Retrieves the number of seconds the driver will wait for a Statement object to execute. If the limit is exceeded, a SQLException is thrown.
Returns:
the current query timeout limit in seconds; zero means there is no limit
Throws:
SQLException - if a database access error occurs
See Also:
setQueryTimeout(int)

Jamie
 
Consider Paul's rocket mass heater.
 
subject: can the data fetching time be extended?