File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases 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 and Relational Databases
Bookmark "can the data fetching time be extended?" Watch "can the data fetching time be extended?" New topic

can the data fetching time be extended?

Padma Prasad
Ranch Hand

Joined: Sep 16, 2002
Posts: 76
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

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.
the current query timeout limit in seconds; zero means there is no limit
SQLException - if a database access error occurs
See Also:

I agree. Here's the link:
subject: can the data fetching time be extended?
It's not a secret anymore!