Re: [BUGS]log can not be output when use DataSource

From: dmp <danap(at)ttc-cmc(dot)net>
To: Chen Huajun <chenhj(at)cn(dot)fujitsu(dot)com>, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: [BUGS]log can not be output when use DataSource
Date: 2013-01-29 17:23:30
Message-ID: 51080592.5080904@ttc-cmc.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc


>> 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.

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Hari Babu 2013-01-31 13:20:53 Re: JDBC connection test with SSL on PG 9.2.1 server
Previous Message Dave Cramer 2013-01-29 16:59:12 Re: Bug report: NullPointerException from Driver.connect when passed a Properties with non-string values