Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 16AB2632E57 for ; Wed, 16 Jun 2010 15:43:54 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 83752-01 for ; Wed, 16 Jun 2010 18:43:36 +0000 (UTC) Received: from mx3.hub.org (mx3.hub.org [206.223.169.73]) by mail.postgresql.org (Postfix) with ESMTP id 46549632AEE for ; Wed, 16 Jun 2010 15:43:37 -0300 (ADT) X-Greylist: delayed 00:32:55.285299 by SQLgrey-1.7.6 Received: from smtp.fhcrc.org (JARCON.FHCRC.ORG [140.107.42.30]) by mx3.hub.org (Postfix) with ESMTP id C49DF37B51E for ; Wed, 16 Jun 2010 15:43:36 -0300 (ADT) Received: from [10.6.125.58] (HIVWALL.SCHARP.ORG [140.107.164.65]) by smtp.fhcrc.org (Postfix) with ESMTP id 891F918A3F for ; Wed, 16 Jun 2010 11:07:12 -0700 (PDT) Message-ID: <4C1912D0.8010405@scharp.org> Date: Wed, 16 Jun 2010 11:07:12 -0700 From: Scott Langley User-Agent: Thunderbird 2.0.0.23 (X11/20090825) MIME-Version: 1.0 To: pgsql-jdbc@postgresql.org Subject: Java .pgpass reader Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.8 tagged_above=-10 required=5 tests=BAYES_50=0.8, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201006/57 X-Sequence-Number: 20627 Did anyone ever implement code in Java to read Postgres configuration information from a user's .pgpass file - or a more general pg_service.conf - as discussed in this thread back in 2006? > > * *From*: David Fetter > * *To*: PostgreSQL JDBC List > * *Subject*: pg_service.conf ? > * *Date*: Mon, 13 Mar 2006 19:23:06 -0800 > http://archives.postgresql.org/pgsql-jdbc/2006-03/msg00060.php http://groups.google.com/group/pgsql.interfaces.jdbc/browse_thread/thread/fa5669c89282d898/0f438795270b1a3a My organization uses .pgpass files to securely store and read user's passwords when user run applications in Perl and Python but currently not for Java. A search on Google finds one implementation in Java for reading configuration info from a .pgpass file, but it is provided under a somewhat restrictive license: http://rb.dcache.org/r/1308/ modules/srm/src/org/dcache/srm/util/Pgpass.java http://www.dcache.org/manuals/dCacheSoftwareLicence.html Of course, it's not like the implementation of this class is very hard, but why reinvent the wheel if you don't have to. Thanks. -- Scott Langley Systems Analyst/Programmer Statistical Center for HIV/AIDS Research and Prevention (SCHARP) Fred Hutchinson Cancer Research Center Seattle, Washington slangley@scharp.org