From: Jürgen Rose <cptmauli@googlemail.com>
To: List <pgsql-jdbc@postgresql.org>
Subject: properties and url
Date: Mon, 14 Apr 2014 18:42:23 +0200
Message-ID: <534C0FEF.6000504@googlemail.com> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: cptmauli@googlemail.com
Subject: Re: properties and url
In-Reply-To: <534C0FEF.6000504@googlemail.com>
References: <534C0FEF.6000504@googlemail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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