pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
PGSimpleDataSource not support jdbc url
5+ messages / 2 participants
[nested] [flat]

* PGSimpleDataSource not support jdbc url
@ 2012-05-04 17:46  Shijun Kong <skong@investoranalytics.com>
  0 siblings, 1 reply; 5+ messages in thread

From: Shijun Kong @ 2012-05-04 17:46 UTC (permalink / raw)
  To: pgsql-jdbc

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<mailto:skong@investoranalytics.com>
www.investoranalytics.com<http://www.investoranalytics.com/;
www.riskology.com<http://www.Riskology.com/;

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: PGSimpleDataSource not support jdbc url
@ 2012-05-04 17:52  Dave Cramer <pg@fastcrypt.com>
  parent: Shijun Kong <skong@investoranalytics.com>
  0 siblings, 1 reply; 5+ messages in thread

From: Dave Cramer @ 2012-05-04 17:52 UTC (permalink / raw)
  To: Shijun Kong <skong@investoranalytics.com>; +Cc: pgsql-jdbc

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



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: PGSimpleDataSource not support jdbc url
@ 2012-05-04 17:59  Shijun Kong <skong@investoranalytics.com>
  parent: Dave Cramer <pg@fastcrypt.com>
  0 siblings, 1 reply; 5+ messages in thread

From: Shijun Kong @ 2012-05-04 17:59 UTC (permalink / raw)
  To: Dave Cramer <pg@fastcrypt.com>; +Cc: pgsql-jdbc

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




^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: PGSimpleDataSource not support jdbc url
@ 2012-05-04 18:19  Dave Cramer <pg@fastcrypt.com>
  parent: Shijun Kong <skong@investoranalytics.com>
  0 siblings, 1 reply; 5+ messages in thread

From: Dave Cramer @ 2012-05-04 18:19 UTC (permalink / raw)
  To: Shijun Kong <skong@investoranalytics.com>; +Cc: pgsql-jdbc

Shijun,

Well the JDBC API does not support getting a DataSource via a URL.

Dave Cramer

dave.cramer(at)credativ(dot)ca
http://www.credativ.ca


On Fri, May 4, 2012 at 1:59 PM, Shijun Kong <skong@investoranalytics.com> wrote:
> 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
>



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: PGSimpleDataSource not support jdbc url
@ 2012-05-04 18:30  Shijun Kong <skong@investoranalytics.com>
  parent: Dave Cramer <pg@fastcrypt.com>
  0 siblings, 0 replies; 5+ messages in thread

From: Shijun Kong @ 2012-05-04 18:30 UTC (permalink / raw)
  To: Dave Cramer <pg@fastcrypt.com>; +Cc: pgsql-jdbc

Hi Dave, 

I didn't say it is a part of JDBC API, if you look DataSource interface,
it has nothing about database server, port, username or password. Not any
of them. 

It is just a minor feature which I think is handy to have. And I am asking
here if anyone aware of any future plan of this part, because I did not
find a feature requesting / bug tracking page here:
http://jdbc.postgresql.org/



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

>Shijun,
>
>Well the JDBC API does not support getting a DataSource via a URL.
>
>Dave Cramer
>
>dave.cramer(at)credativ(dot)ca
>http://www.credativ.ca
>
>
>On Fri, May 4, 2012 at 1:59 PM, Shijun Kong <skong@investoranalytics.com>
>wrote:
>> 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
>>




^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2012-05-04 18:30 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2012-05-04 17:46 PGSimpleDataSource not support jdbc url Shijun Kong <skong@investoranalytics.com>
2012-05-04 17:52 ` Dave Cramer <pg@fastcrypt.com>
2012-05-04 17:59   ` Shijun Kong <skong@investoranalytics.com>
2012-05-04 18:19     ` Dave Cramer <pg@fastcrypt.com>
2012-05-04 18:30       ` Shijun Kong <skong@investoranalytics.com>

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