Re: Bug report: NullPointerException from Driver.connect when passed a Properties with non-string values - Mailing list pgsql-jdbc

From Dave Cramer
Subject Re: Bug report: NullPointerException from Driver.connect when passed a Properties with non-string values
Date
Msg-id CADK3HH+HzD_bQ00gLo4FcaXYsnsiLugBczGYdq2me=g=5T+RrQ@mail.gmail.com
Whole thread Raw
In response to Re: Bug report: NullPointerException from Driver.connect when passed a Properties with non-string values  (dmp <danap@ttc-cmc.net>)
Responses Re: Bug report: NullPointerException from Driver.connect when passed a Properties with non-string values  (Nathaniel Waisbrot <waisbrot@highfleet.com>)
Re: Bug report: NullPointerException from Driver.connect when passed a Properties with non-string values  (dmp <danap@ttc-cmc.net>)
List pgsql-jdbc
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> 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:
Dave Cramer<pg@fastcrypt.com>  wrote:

My proposed patch is this


if (url.startsWith("jdbc:postgresql:")) {
      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)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc

pgsql-jdbc by date:

Previous
From: dmp
Date:
Subject: Re: Bug report: NullPointerException from Driver.connect when passed a Properties with non-string values
Next
From: Nathaniel Waisbrot
Date:
Subject: Re: Bug report: NullPointerException from Driver.connect when passed a Properties with non-string values