From: | Markus Schaber <schabi(at)logix-tt(dot)com> |
---|---|
To: | Mark Lewis <mark(dot)lewis(at)mir3(dot)com> |
Cc: | David Fetter <david(at)fetter(dot)org>, Jan de Visser <jdevisser(at)digitalfairway(dot)com>, pgsql-jdbc(at)postgresql(dot)org |
Subject: | Re: pg_service.conf ? |
Date: | 2006-03-22 14:36:33 |
Message-ID: | 442160F1.20704@logix-tt.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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
From | Date | Subject | |
---|---|---|---|
Next Message | Xavier Poinsard | 2006-03-22 14:55:00 | Re: Patch implementing escaped functions timestampadd and |
Previous Message | Dave Cramer | 2006-03-22 12:23:47 | Re: Patch implementing escaped functions timestampadd and timestampdiff |