Re: pg_service.conf ?

Поиск
Список
Период
Сортировка
От Markus Schaber
Тема Re: pg_service.conf ?
Дата
Msg-id 442160F1.20704@logix-tt.com
обсуждение исходный текст
Ответ на Re: pg_service.conf ?  (Mark Lewis <mark.lewis@mir3.com>)
Список pgsql-jdbc
Hi, Mark,

Mark Lewis wrote:

> String getEnv(String name) {
>   try {
>     Method m;
>     m = System.class.getMethod("getEnv", new Class[]{String.class});
>     return (String)m.invoke(null, new Object[]{name});
>   }
>   catch(Exception ex) {
>     // Must not be running 1.5 or later
>     return null;
>   }
> }

I don't think you need reflection there, because the method was present
since very old JDK libs, but deprecated (and thus throwing an exception)
in 1.3 and 1.4.

> So looking in PG_JDBC_SERVICE_CONF and PGSYSCONFDIR would require 1.5,
> although looking in the user's home dir is still possible with older
> versions because you can inspect the user.dir System property.

Ah, I knew there as a possibility to get the users home directory.
user.dir should work even under those Windows environments that really
support multiple user accounts.

HTH,
Markus

--
Markus Schaber | Logical Tracking&Tracing International AG
Dipl. Inf.     | Software Development GIS

Fight against software patents in EU! www.ffii.org www.nosoftwarepatents.org

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

Предыдущее
От: Dave Cramer
Дата:
Сообщение: Re: Patch implementing escaped functions timestampadd and timestampdiff
Следующее
От: "Xavier Poinsard"
Дата:
Сообщение: Re: Patch implementing escaped functions timestampadd and