Re: [BUGS]log can not be output when use DataSource - Mailing list pgsql-jdbc

From Chen Huajun
Subject Re: [BUGS]log can not be output when use DataSource
Date
Msg-id 510D5247.5030508@cn.fujitsu.com
Whole thread Raw
In response to Re: [BUGS]log can not be output when use DataSource  (dmp <danap@ttc-cmc.net>)
Responses Re: [BUGS]log can not be output when use DataSource
List pgsql-jdbc
Hi

I have made a new patch for BaseDataSource ,please check it.
Some modifications in getReference() is just for keeping
the same style to other String parameters .

Chen Huajun
(2013/01/30 1:23), dmp wrote:
>
>  >> dmp wote:
>>> 3. The fourth column Chen in your spreadsheet is usefull in identifying two
>>> properties that are defined in the BaseDataSource but not implemented
>>> in getURL(). The properties user & password are included in getConnection()
>>> and therefore do not not need to be in getURL(). The two not implemented:
>>
>
> Chen Huajun wrote:
>> I advocate user & password also need to be in getURL().
>> Because getURL() is the key way to affect a connection created by the DataSource.
>> If a property not need be included in getURL(),it also seems not needed to appear in BaseDataSource.
>> And just like DriverManager,by which can set user & password via getConnection's arguments or url,
>> DataSource should same to DriverManager.
>>
>> Connection db = DriverManager.getConnection(url, username, password);
>>
>> or
>>
>> String url = "jdbc:postgresql://localhost/test?user=fred&password=secret&ssl=true";
>> Connection conn = DriverManager.getConnection(url);
>
> If this is a route you would like to take then that can be included with the
> patch for review. The Java API for the DataSource though only indicates the
> two methods:
>
> Connection getConnection()
> Connection getConnection(String username, String password)
>
> Therefore they must stay. The two additional methods you advocate only make
> more work, but has you say allows more flexibility.
>
> Chen, this project is really short of contributors so any major changes to the
> code must be accompanied by testing on your part. Maintenance seems to be me
> to be the main priority until that changes. That is why since you were familiar
> with the BaseDataSource logLevel bug I asked if you could review, to see if
> there were other similar bugs in that class for the properties.
>
> danap.
>
>
>
>

--
Best Regards
--------------------------------------------------
   富士通南大軟件技術有限公司(FNST)
   第二ソフトウェア事業部第三開発部
   陳華軍(チン カグン)
   Addr: 南京富士通南大軟件技術有限公司(FNST)
         中国南京市雨花台区文竹路6号(210012)
   Mail: chenhj@cn.fujitsu.com
   Tel : +86+25-86630566-8406  内線: 7998-8406
   Fax : +86+25-83317685
--------------------------------------------------

Attachment

pgsql-jdbc by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: [GENERAL] JDBC connection test with SSL on PG 9.2.1 server
Next
From: dmp
Date:
Subject: Re: [BUGS]log can not be output when use DataSource