X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 91DD99DC83C for ; Wed, 22 Mar 2006 10:36:28 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 65727-04-2 for ; Wed, 22 Mar 2006 10:36:31 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mail.logix-tt.com (unknown [212.211.145.186]) by postgresql.org (Postfix) with ESMTP id 58F149DD57D for ; Wed, 22 Mar 2006 10:36:24 -0400 (AST) Received: from kingfisher.intern.logix-tt.com (Ta81a.t.pppool.de [89.55.168.26]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.logix-tt.com (Postfix) with ESMTP id 787AA657BA; Wed, 22 Mar 2006 15:37:00 +0100 (CET) Received: from [127.0.0.1] (localhost [127.0.0.1]) by kingfisher.intern.logix-tt.com (Postfix) with ESMTP id D2F6D1852EF84; Wed, 22 Mar 2006 15:36:34 +0100 (CET) Message-ID: <442160F1.20704@logix-tt.com> Date: Wed, 22 Mar 2006 15:36:33 +0100 From: Markus Schaber Organization: Logical Tracking and Tracing International AG, Switzerland User-Agent: Debian Thunderbird 1.0.7 (X11/20051017) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Mark Lewis Cc: David Fetter , Jan de Visser , pgsql-jdbc@postgresql.org Subject: Re: pg_service.conf ? 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> In-Reply-To: <1142970005.23722.72.camel@archimedes> X-Enigmail-Version: 0.93.0.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.101 required=5 tests=[AWL=0.101] X-Spam-Score: 0.101 X-Spam-Level: X-Archive-Number: 200603/96 X-Sequence-Number: 14877 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