DataSource lookup

Поиск
Список
Период
Сортировка
От Nico
Тема DataSource lookup
Дата
Msg-id d2od8k$c4s$1@news.hub.org
обсуждение исходный текст
Ответы Re: DataSource lookup  (luke@chipcity.com.au)
Список pgsql-jdbc
How do I find out what's the name of the JNDI data source I need for a
PostgreSQL connection pool?
Currently I do this,

javax.naming.Context env=(javax.naming.Context)
new javax.naming.InitialContext().lookup("java:comp/env");
pool=(DataSource)env.lookup("jdbc/"+dbname);
connection=pool.getConnection("username","password");

but then I get a MySQL connection(MySQL & PostgreSQL run both on server).
I only have permission to my personal account, not the shared directories
where I think the jndi resources are located. In my web.xml are no resources
defined.

Kind regards,
Nico.



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

Предыдущее
От: Kris Jurka
Дата:
Сообщение: Re: JDBC and transactions
Следующее
От: "Chris White (cjwhite)"
Дата:
Сообщение: Re: JDBC and transactions