Re: JBDC LDAP support for connection parameters

From: Craig Ringer <craig(at)2ndquadrant(dot)com>
To: Sehrope Sarkuni <sehrope(at)jackdb(dot)com>, John Neal <john(dot)neal(at)fedex(dot)com>
Cc: "pgsql-jdbc(at)postgresql(dot)org" <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: JBDC LDAP support for connection parameters
Date: 2014-08-19 01:48:48
Message-ID: 53F2AD00.7050209@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On 07/24/2014 04:17 AM, Sehrope Sarkuni wrote:
> John,
>
> No, the JDBC driver does not support loading data source configuration
> from LDAP or using pg_service.conf. You'll need to specify the
> database host/port/user as part of the JDBC connection string.
>
> If this custom application code where you can dynamically generate the
> JDBC URL then you could probably write it yourself (ie. query LDAP for
> the server details and build the connection string from it).
>
> If it's meant to be injected into an app server where you don't have
> full control (ex: adding it as a JNDI resource to a JEE server)
> though, I'm not sure of any workaround short of writing a wrapper JDBC
> driver that transparently does the LDAP lookup for you and then
> internally creates a PG JDBC connection from it.

It would make a great deal more sense to simply patch PgJDBC with the
desired LDAP support.

Patches like that are generally welcome if submitted upstream,
especially if they increase compatibility with and consistency wit libpq.

--
Craig Ringer http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Mike Fowler 2014-08-19 08:17:40 Buildfarm compile failure
Previous Message Dave Cramer 2014-08-19 01:47:46 Re: [ODBC] BIRT report opening multiple connections