Обсуждение: DriverManager.setLoginTimeout question

Поиск
Список
Период
Сортировка

DriverManager.setLoginTimeout question

От
"kangch"
Дата:
Hi,
 
According to JDBC API, DriverManager.setLoginTimeout methos is
Sets the maximum time in seconds that a driver will wait while attempting to connect to a database
 
I am testing this method "setLoginTimeout(3) -> 3 seconds"
 
Class.forName("org.postgresql.Driver");
DriverManager.setLoginTimeout(3);
conn = DriverManager.getConnection(
                                        "jdbc:postgresql://test:5432/test1",
                                        "test2",
                                        "test3");
but, it's not working...
It takes about 2 minutes or 3 minutes, if the postgreSQL is not exist
I want to know that setLoginTimeout is work or not work in postgreSQL.
 
If you know another method, please answer to me the solution...
I want to receive more quickly to the postgreSQL, if postgreSQL is not exist.
 
Cheers
 
Kang