Thread: [PATCH] Expose URL property in BaseDataSource

[PATCH] Expose URL property in BaseDataSource

From
Loïc PÉRON
Date:
Hi all,

The attached patch does the following:

- changes visibility of Driver.parseUrl to public static
 - changes visibility of BaseDataSource.getUrl to public
 - add setUrl to BaseDataSourc based on Driver.parseUrl

Adding this property to all datasources simplifies their set-up by
 using the same url/user/pass as with DriverManager.

--
Loïc PÉRON
mailto:loic.peron<at>bigfoot.com

Attachment

Re: [PATCH] Expose URL property in BaseDataSource

From
Dave Cramer
Date:
Looking at the spec these are not part of the Datasource API ? Or am I mistaken ?

Dave Cramer

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


On Mon, Mar 11, 2013 at 10:23 AM, Loïc PÉRON <loic.peron@bigfoot.com> wrote:
Hi all,

The attached patch does the following:

- changes visibility of Driver.parseUrl to public static
 - changes visibility of BaseDataSource.getUrl to public
 - add setUrl to BaseDataSourc based on Driver.parseUrl

Adding this property to all datasources simplifies their set-up by
 using the same url/user/pass as with DriverManager.

--
Loïc PÉRON
mailto:loic.peron<at>bigfoot.com


--
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc


Re: [PATCH] Expose URL property in BaseDataSource

From
Loïc PÉRON
Date:
2013/3/11 Dave Cramer <pg@fastcrypt.com>:
> Looking at the spec these are not part of the Datasource API ? Or am I
> mistaken ?

No they are not, but in fact no connection property is mandated by the
spec regarding DataSources.

It is simply a convenient way of configuring the DataSource, similar
to the configuration through DriverManager: url+user+pass

As the URL parsing is already present in Driver, and the URL building
in BaseDataaSource, I just connected url parsing to the BaseDataSource
attributes.

We currently use Oracle, HSQLDB and Postgresql, which is the only one
not exposing a URL property for datasources.

--
Loïc PÉRON
phone:(33) 683 880 177
mailto:loic.peron<at>bigfoot.com


Re: [PATCH] Expose URL property in BaseDataSource

From
Loïc PÉRON
Date:
Hi,

Is the patch attached to my initial message
(http://www.postgresql.org/message-id/CAFKiveQyuA+PQ310pV3tLB5yyjWWbNsuyMaLcpuEW3jk8F_uFg@mail.gmail.com)
acceptable? Does it need more work?

--
Loïc PÉRON
mailto:loic.peron<at>bigfoot.com


Re: [PATCH] Expose URL property in BaseDataSource

From
LoïcPÉRON
Date:
Hi Dave,

May the patch be included in the upcoming PostgreSQL 9.3 JDBC driver?

http://www.postgresql.org/message-
id/CAFKiveQyuA+PQ310pV3tLB5yyjWWbNsuyMaLcpuEW3jk8F_uFg@mail.gmail.com

Thanks.


Re: [PATCH] Expose URL property in BaseDataSource

From
Dave Cramer
Date:
Hi,

I expect so yes.

Dave Cramer

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


On Wed, May 22, 2013 at 8:17 AM, LoïcPÉRON <loic.peron@bigfoot.com> wrote:
Hi Dave,

May the patch be included in the upcoming PostgreSQL 9.3 JDBC driver?

http://www.postgresql.org/message-
id/CAFKiveQyuA+PQ310pV3tLB5yyjWWbNsuyMaLcpuEW3jk8F_uFg@mail.gmail.com

Thanks.




--
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc

Re: [PATCH] Expose URL property in BaseDataSource

From
Dave Cramer
Date:
Why does the parseURL need to be static or even public in the Driver ?

Dave Cramer

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


On Wed, May 22, 2013 at 8:24 AM, Dave Cramer <pg@fastcrypt.com> wrote:
Hi,

I expect so yes.

Dave Cramer

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


On Wed, May 22, 2013 at 8:17 AM, LoïcPÉRON <loic.peron@bigfoot.com> wrote:
Hi Dave,

May the patch be included in the upcoming PostgreSQL 9.3 JDBC driver?

http://www.postgresql.org/message-
id/CAFKiveQyuA+PQ310pV3tLB5yyjWWbNsuyMaLcpuEW3jk8F_uFg@mail.gmail.com

Thanks.




--
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc


Re: [PATCH] Expose URL property in BaseDataSource

From
LoïcPÉRON
Date:
Dave Cramer <pg <at> fastcrypt.com> writes:

> Why does the parseURL need to be static or even public in the Driver ?

To be used from BaseDataSource without requiring instantiation.

--
Loïc PÉRON