pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Scott Langley <slangley@scharp.org>
To: pgsql-jdbc@postgresql.org
Subject: Java .pgpass reader
Date: Wed, 16 Jun 2010 11:07:12 -0700
Message-ID: <4C1912D0.8010405@scharp.org> (raw)

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 <david(at)fetter(dot)org>
>     * *To*: PostgreSQL JDBC List <pgsql-jdbc(at)postgresql(dot)org>
>     * *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/0f4387952...

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://rb.dcache.org/r/1308/diff/1/?file=9469#file9469line54;
 
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





view thread (4+ messages)  latest in thread

Message-ID: <4C1912D0.8010405@scharp.org>
Permalink:  ../4C1912D0.8010405@scharp.org/
Also on:    postgresql.org/message-id/4C1912D0.8010405@scharp.org

 · 

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: slangley@scharp.org
  Subject: Re: Java .pgpass reader
  In-Reply-To: <4C1912D0.8010405@scharp.org>
  References: <4C1912D0.8010405@scharp.org>

* 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