jdbc connection - UnknownHostException

Поиск
Список
Период
Сортировка
От Yann Calderara
Тема jdbc connection - UnknownHostException
Дата
Msg-id 20031223005955.78fa81b6.cy@netlabs.org
обсуждение исходный текст
Ответы Re: jdbc connection - UnknownHostException  ("Nick Fankhauser" <nickf@ontko.com>)
Список pgsql-jdbc
Hello list,
Can anyone help me with this issue?
I'm trying to write a bean (used within the struts framwork) that gives some methods about managing the database,
locatedon http://myhost1.org. After some attempts, the connection succeded, but when a tried it again, I received an
UnknownHostException.I've then tried after many things to connect through the db with another alias, http://myhost2.org
(whichis the very same ip than myhost1.org), and it works a few times. 

I've then written a small test class, which looks very like what is in the bean, to connect on a postgresql:

Class.forName("org.postgresql.Driver"); //load the driver
db=DriverManager.getConnection("jdbc:postgresql://myhost1.org:5432/dbname", "user", "pwd");
//...
db.close();

and it works fine, no exceptions (loading driver and connecting ok).
But in the same time, the connection in the bean does not succeed any more...

The driver is always correctly loaded.
What am I missing? thanks for any answer :)
yann


--
Yann Calderara <cy@netlabs.org>
OpenPGP: 8E31751C / 26EA EDA3 1671 CCCF 815D 89A4 307D 4B8E 8E31 751C


Вложения

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

Предыдущее
От: Dave Cramer
Дата:
Сообщение: Re: Newbie question
Следующее
От: "Nick Fankhauser"
Дата:
Сообщение: Re: jdbc connection - UnknownHostException