A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
The Java EE 7 Tutorial Volume 1 or Volume 2
this week in the
jQuery UI in Action
Regarding setLoginTimeout(int seconds) in JDBC
Joined: Jan 30, 2009
Feb 19, 2009 07:55:24
The docs say that
public static void setLoginTimeout(int seconds)
Sets the maximum time in seconds that a driver will wait while attempting to connect to a database.
Now if i set a Connection TimeOut for 5 secs , and how can i throw an exception on this if it exceeds 5 secs ??
If you want something you never had do something which you had never done
Joined: Oct 23, 2005
Feb 23, 2009 22:07:19
It will throw the exception for you. You can catch it by putting a try/catch around the connection code.
Down Home Country Coding with Scott Selikoff
I agree. Here's the link:
subject: Regarding setLoginTimeout(int seconds) in JDBC
Need help with a graceful failed database connection recovery
inconvertible types found : int required: java.lang.Short
read timeout not working after given period
JVM memory releasing after memory consuming task
Adding 2 Times Together
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014