How to set a connection timeout

Поиск
Список
Период
Сортировка
От Ricardo Maia
Тема How to set a connection timeout
Дата
Msg-id 0110031549540D.00770@valkyrie
обсуждение исходный текст
Список pgsql-jdbc
Hi,

I'am having some problems to set a connection timeout.

By default, when the IP set in the URL is incorrect (e.g doesn't exist or the
machine is down) the getConnection call takes too long to throw an exception.

I whould like to set this timeout to a few seconds.

I tried the following code, but it still doesn't work:

DriverManager.setLoginTimeout(10);
try{
      jConnection = DriverManager.getConnection (f_strURL, f_strUsername,
f_strPassword);
    }
catch(Exception e){


Thanks

Ricardo Maia

В списке pgsql-jdbc по дате отправления:

Предыдущее
От: "Arsalan Zaidi"
Дата:
Сообщение: java.lang.OutOfMemory Exception with a large number of inserts
Следующее
От: Rene Pijlman
Дата:
Сообщение: Re: java.lang.OutOfMemory Exception with a large number of inserts