Re: pg_service.conf ? - Mailing list pgsql-jdbc

From Markus Schaber
Subject Re: pg_service.conf ?
Date
Msg-id 442160F1.20704@logix-tt.com
Whole thread Raw
In response to Re: pg_service.conf ?  (Mark Lewis <mark.lewis@mir3.com>)
List 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 by date:

Previous
From: Dave Cramer
Date:
Subject: Re: Patch implementing escaped functions timestampadd and timestampdiff
Next
From: "Xavier Poinsard"
Date:
Subject: Re: Patch implementing escaped functions timestampadd and