• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Trying to set query timeout for PreparedStatement object

 
Susan Smith
Ranch Hand
Posts: 224
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I'm trying to set query timeout for a PreparedStatement object (below is the code snippet).
I set the query timeout to "1" second just for testing first. But I notice the query takes longer than 1 second but it is successfully executed. No SQLException is thrown. I'm confused why this doesn't work. Can someone please advise?



Thanks in advance for all the help.
 
Susan Smith
Ranch Hand
Posts: 224
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Sorry to bother you guys again.
Just want to follow up if anyone knows some pointers to my question.

Thanks again in advance for the help.
Let me know if I can provide more information.
 
Rich Remington
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just read that the timing (when the timeout exception is thrown) is not very precise and may take a few seconds to actually materialize. Your query may have completed before then.

Here is a reference URL for your reading pleasure -> http://forums.oracle.com/forums/thread.jspa?threadID=550257

HTH

Susan Smith wrote:Hi,

Sorry to bother you guys again.

...
 
Rob Spoor
Sheriff
Pie
Posts: 20750
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No idea why I haven't moved this thread before, but it clearly belongs in our JDBC forum. Finally moving it.
 
Balu Sadhasivam
Ranch Hand
Posts: 874
Android Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

No idea why I haven't moved this thread before, but it clearly belongs in our JDBC forum. Finally moving it.

yeah certainly would have triggered better responses in JDBC.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic