pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Markus Schaber <schabi@logix-tt.com>
To: Mark Lewis <mark.lewis@mir3.com>
Cc: David Fetter <david@fetter.org>
Cc: Jan de Visser <jdevisser@digitalfairway.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: pg_service.conf ?
Date: Wed, 22 Mar 2006 15:36:33 +0100
Message-ID: <442160F1.20704@logix-tt.com> (raw)
In-Reply-To: <1142970005.23722.72.camel@archimedes>
References: <20060314032306.GA6901@fetter.org>
	<4416E6CB.803@opencloud.com>
	<441AE333.2010003@logix-tt.com>
	<200603171152.24287.jdevisser@digitalfairway.com>
	<20060321185624.GA28126@fetter.org>
	<1142970005.23722.72.camel@archimedes>

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



view thread (23+ messages)

Message-ID: <442160F1.20704@logix-tt.com>
Permalink:  ../442160F1.20704@logix-tt.com/
Also on:    postgresql.org/message-id/442160F1.20704@logix-tt.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: schabi@logix-tt.com, mark.lewis@mir3.com, david@fetter.org, jdevisser@digitalfairway.com
  Subject: Re: pg_service.conf ?
  In-Reply-To: <442160F1.20704@logix-tt.com>
  References: <20060314032306.GA6901@fetter.org> <4416E6CB.803@opencloud.com> <441AE333.2010003@logix-tt.com> <200603171152.24287.jdevisser@digitalfairway.com> <20060321185624.GA28126@fetter.org> <1142970005.23722.72.camel@archimedes> <442160F1.20704@logix-tt.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox