R
RC
The Subject says its all.
I can't do
DriverManager dm = new DriverManager();
But I can do
Connection c = DriverManger.getConnection("jdbc:......", properties);
My question is how do I use
DriverManger.setLoginTimeout(10);
to set the connection time out. If after 10 seconds still not
able to connect to the database, then time out. throw to
Exception
By default if there is something wrong with the database server
or the host. It may takes 30 seconds to catch in Exception.
I want to shorter it to only 10 seconds. How do I do that?
Thank Q very much in advance!
I can't do
DriverManager dm = new DriverManager();
But I can do
Connection c = DriverManger.getConnection("jdbc:......", properties);
My question is how do I use
DriverManger.setLoginTimeout(10);
to set the connection time out. If after 10 seconds still not
able to connect to the database, then time out. throw to
Exception
By default if there is something wrong with the database server
or the host. It may takes 30 seconds to catch in Exception.
I want to shorter it to only 10 seconds. How do I do that?
Thank Q very much in advance!