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

* properties and url
@ 2014-04-14 16:42 Jürgen Rose <cptmauli@googlemail.com>
  2014-04-14 17:07 ` Re: properties and url Dave Cramer <pg@fastcrypt.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Jürgen Rose @ 2014-04-14 16:42 UTC (permalink / raw)
  To: pgsql-jdbc

Hi,

when I look at that code:

    public void setUrl(String url) throws SQLException {

        Properties p = org.postgresql.Driver.parseURL(url, null);
         serverName = p.getProperty("PGHOST", "localhost");
         portNumber = Integer.parseInt(p.getProperty("PGPORT", "0"));
         databaseName = p.getProperty("PGDBNAME");
         loginTimeout = Integer.parseInt(p.getProperty("loginTimeout",
"0"));
         socketTimeout = Integer.parseInt(p.getProperty("socketTimeout",
"0"));
         prepareThreshold =
Integer.parseInt(p.getProperty("prepareThreshold", "5"));
         unknownLength = Integer.parseInt(p.getProperty("unknownLength",
"0"));
         logLevel = Integer.parseInt(p.getProperty("loglevel", "0"));
         protocolVersion =
Integer.parseInt(p.getProperty("protocolVersion", "0"));
         ssl = Boolean.parseBoolean(p.getProperty("ssl"));
         sslfactory = p.getProperty("sslfactory");
         receiveBufferSize =
Integer.parseInt(p.getProperty("receiveBufferSize", "-1"));
         sendBufferSize =
Integer.parseInt(p.getProperty("sendBufferSize", "-1"));
         tcpKeepAlive = Boolean.parseBoolean(p.getProperty("tcpKeepAlive"));
         compatible = p.getProperty("compatible");
         applicationName = p.getProperty("ApplicationName");
        stringType = p.getProperty("stringtype");
         binaryTransfer =
Boolean.parseBoolean(p.getProperty("binaryTransfer"));
         disableColumnSanitiser =
Boolean.parseBoolean(p.getProperty("disableColumnSanitiser"));
    }

I see that all properties, except loglevel and stringtype conform to the
usual property conventions. Any reason behind this, or is it just
historically grown that way?

Its just, when I had a look at some other DataSourceFactoriy
implementations, I saw at least one approach where the properties get
set through reflection. Which would fail in these two cases.

Jürgen


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



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

* Re: properties and url
  2014-04-14 16:42 properties and url Jürgen Rose <cptmauli@googlemail.com>
@ 2014-04-14 17:07 ` Dave Cramer <pg@fastcrypt.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Dave Cramer @ 2014-04-14 17:07 UTC (permalink / raw)
  To: Jürgen Rose <cptmauli@googlemail.com>; +Cc: pgsql-jdbc

Jurgen,


Historic. Feel free to override them

Dave Cramer

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


On 14 April 2014 12:42, Jürgen Rose <cptmauli@googlemail.com> wrote:

> Hi,
>
> when I look at that code:
>
>     public void setUrl(String url) throws SQLException {
>
>         Properties p = org.postgresql.Driver.parseURL(url, null);
>          serverName = p.getProperty("PGHOST", "localhost");
>          portNumber = Integer.parseInt(p.getProperty("PGPORT", "0"));
>          databaseName = p.getProperty("PGDBNAME");
>          loginTimeout = Integer.parseInt(p.getProperty("loginTimeout",
> "0"));
>          socketTimeout = Integer.parseInt(p.getProperty("socketTimeout",
> "0"));
>          prepareThreshold =
> Integer.parseInt(p.getProperty("prepareThreshold", "5"));
>          unknownLength = Integer.parseInt(p.getProperty("unknownLength",
> "0"));
>          logLevel = Integer.parseInt(p.getProperty("loglevel", "0"));
>          protocolVersion =
> Integer.parseInt(p.getProperty("protocolVersion", "0"));
>          ssl = Boolean.parseBoolean(p.getProperty("ssl"));
>          sslfactory = p.getProperty("sslfactory");
>          receiveBufferSize =
> Integer.parseInt(p.getProperty("receiveBufferSize", "-1"));
>          sendBufferSize =
> Integer.parseInt(p.getProperty("sendBufferSize", "-1"));
>          tcpKeepAlive =
> Boolean.parseBoolean(p.getProperty("tcpKeepAlive"));
>          compatible = p.getProperty("compatible");
>          applicationName = p.getProperty("ApplicationName");
>         stringType = p.getProperty("stringtype");
>          binaryTransfer =
> Boolean.parseBoolean(p.getProperty("binaryTransfer"));
>          disableColumnSanitiser =
> Boolean.parseBoolean(p.getProperty("disableColumnSanitiser"));
>     }
>
> I see that all properties, except loglevel and stringtype conform to the
> usual property conventions. Any reason behind this, or is it just
> historically grown that way?
>
> Its just, when I had a look at some other DataSourceFactoriy
> implementations, I saw at least one approach where the properties get
> set through reflection. Which would fail in these two cases.
>
> Jürgen
>
>
> --
> Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-jdbc
>

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


end of thread, other threads:[~2014-04-14 17:07 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2014-04-14 16:42 properties and url Jürgen Rose <cptmauli@googlemail.com>
2014-04-14 17:07 ` Dave Cramer <pg@fastcrypt.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