Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

can the data fetching time be extended?

 
Padma Prasad
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1879
MySQL Database Suse
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic