pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Shijun Kong <skong@investoranalytics.com>
To: Dave Cramer <pg@fastcrypt.com>
Cc: pgsql-jdbc@postgresql.org <pgsql-jdbc@postgresql.org>
Subject: Re: PGSimpleDataSource not support jdbc url
Date: Fri, 4 May 2012 12:59:58 -0500
Message-ID: <CBC98FD5.3726%skong@investoranalytics.com> (raw)
In-Reply-To: <CADK3HHJii7WZUJpJ_kWzn7aut_NwoaMOabQAKrqDjW3qEZuFTw@mail.gmail.com>

When go DriverManager approach, we can do something like:
(http://jdbc.postgresql.org/documentation/80/connect.html)

String url = 
"jdbc:postgresql://localhost/test?user=fred&password=secret&ssl=true";
Connection conn = DriverManager.getConnection(url);



However, if you want to use javax.sql.DataSource approach instead of
DriverManager, the current implementation in PGSimpleDataSource(I am using
8.4, looks like 9.x has the same API) force you providing serverName,
PortNumber, databaseName, user, password one by one via setter methods.
Sure, you can parse a jdbc url to get all these properties and set them
one by one. But prefer a jdbc driver library can do that for end-users
which could save boilerplate code for everyone.



On 5/4/12 1:52 PM, "Dave Cramer" <pg@fastcrypt.com> wrote:

>Shijun,
>
>Can you be more specific ?
>
>Dave Cramer
>
>dave.cramer(at)credativ(dot)ca
>http://www.credativ.ca
>
>
>On Fri, May 4, 2012 at 1:46 PM, Shijun Kong <skong@investoranalytics.com>
>wrote:
>> Hi,
>>
>> I am new to postgreSQL, pgsql-jdbc. If I am not mistaken,
>>PGSimpleDataSource
>> does not support jdbc url. Is there any plan to implement it in future?
>>
>> __________________________
>> Shijun Kong, Software Developer
>> Investor Analytics - Risk Transparency
>>
>> Direct: +1 646.553.4510 x 121
>> Shijun.Kong@investoranalytics.com
>> www.investoranalytics.com
>>
>> www.riskology.com




view thread (5+ messages)  latest in thread

Message-ID: <CBC98FD5.3726%skong@investoranalytics.com>
Permalink:  ../CBC98FD5.3726%25skong@investoranalytics.com/
Also on:    postgresql.org/message-id/CBC98FD5.3726%skong@investoranalytics.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: skong@investoranalytics.com, pg@fastcrypt.com
  Subject: Re: PGSimpleDataSource not support jdbc url
  In-Reply-To: <CBC98FD5.3726%skong@investoranalytics.com>
  References: <CADK3HHJii7WZUJpJ_kWzn7aut_NwoaMOabQAKrqDjW3qEZuFTw@mail.gmail.com> <CBC98FD5.3726%skong@investoranalytics.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