Re: Bug report: NullPointerException from Driver.connect when passed a Properties with non-string values
От | Dave Cramer |
---|---|
Тема | Re: Bug report: NullPointerException from Driver.connect when passed a Properties with non-string values |
Дата | |
Msg-id | CADK3HHJKcLCbn418gE0BbryyB2+d2oXVPPp0Au8WVVZ40228Hg@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Bug report: NullPointerException from Driver.connect when passed a Properties with non-string values (dmp <danap@ttc-cmc.net>) |
Ответы |
Re: Bug report: NullPointerException from Driver.connect when
passed a Properties with non-string values
|
Список | pgsql-jdbc |
Ok, I've got a pending pull request if others could verify it, I'd appreciated it.
Dave
On Mon, Jan 28, 2013 at 4:20 PM, dmp <danap@ttc-cmc.net> wrote:
I understand. Better also thow in:
if (info != null)
{
for (Enumeration e = info.propertyNames(); e.hasMoreElements();)
{
String propName = (String)e.nextElement();
props.setProperty(propName, info.getProperty(propName));
}
}
and Nathaniel's patch. With yours, the above, and Nathaniel's that
should cover everything I think.
danap.
Dave Cramer wrote:it irks me to have to do that, as the java api for getProperty suggests
that you cannot have anything but a string in there, however it's not
worth fighting for.
Dave
Dave Cramer
dave.cramer(at)credativ(dot)ca
http://www.credativ.ca
On Mon, Jan 28, 2013 at 4:03 PM, dmp <danap@ttc-cmc.net<mailto:danap@ttc-cmc.net>> wrote:Dave Cramer<pg@fastcrypt.com <mailto:pg@fastcrypt.com>> wrote:
I think that is what threw me. You are still going to need to
have Nathaniel's patch in case someone does try to throw in a bogus
properties that ends up null even thought the url is correct.
danap.
Kevin Grittner wrote:if (url.startsWith("jdbc:__postgresql:")) {
My proposed patch is this
return null;
}
Right at the top of getConnection, before we do any real work.
Thoughts ?
Shouldn't that have a bang to reverse the logic?
-Kevin
-Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org<mailto:pgsql-jdbc@postgresql.org>)http://www.postgresql.org/__mailpref/pgsql-jdbc
To make changes to your subscription:
<http://www.postgresql.org/mailpref/pgsql-jdbc>
В списке pgsql-jdbc по дате отправления: