pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: dmp <danap@ttc-cmc.net>
To: Dave Cramer <pg@fastcrypt.com>
To: pgsql-jdbc@postgresql.org
Subject: Re: Bug report: NullPointerException from Driver.connect when passed a Properties with non-string values
Date: Mon, 28 Jan 2013 14:20:17 -0700
Message-ID: <5106EB91.1040107@ttc-cmc.net> (raw)
In-Reply-To: <CADK3HH+HzD_bQ00gLo4FcaXYsnsiLugBczGYdq2me=g=5T+RrQ@mail.gmail.com>
References: <74B305A4-D481-4D4C-8E0E-8EBAB50CF584@highfleet.com>
	<5106C07B.8020800@ttc-cmc.net>
	<CADK3HHK9HgJ+-2x9cBMbH9VryUoNvTAbzcG1D+xgN9WR=05vEw@mail.gmail.com>
	<E67FF73D-0FCA-406A-A03B-BFB1398B9936@highfleet.com>
	<CADK3HHKv+_nhrHsw9T8ymt277FiyQ_x3jU95LE6ObGaD60Sm-Q@mail.gmail.com>
	<CADK3HHJrkvmLKcRtkOf6i_a1sk2+haewd-2NeuEgCNNz1AT11Q@mail.gmail.com>
	<1359406432.56292.YahooMailNeo@web162904.mail.bf1.yahoo.com>
	<5106E796.8070204@ttc-cmc.net>
	<CADK3HH+HzD_bQ00gLo4FcaXYsnsiLugBczGYdq2me=g=5T+RrQ@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-jdbc>

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:
>
>     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 <mailto: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
>     <mailto:pgsql-jdbc@postgresql.org>)
>     To make changes to your subscription:
>     http://www.postgresql.org/__mailpref/pgsql-jdbc
>     <http://www.postgresql.org/mailpref/pgsql-jdbc;
>
>



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



view thread (21+ messages)  latest in thread

Message-ID: <5106EB91.1040107@ttc-cmc.net>
Permalink:  ../5106EB91.1040107@ttc-cmc.net/
Also on:    postgresql.org/message-id/5106EB91.1040107@ttc-cmc.net

 · 

reply

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: danap@ttc-cmc.net, pg@fastcrypt.com
  Subject: Re: Bug report: NullPointerException from Driver.connect when passed a Properties with non-string values
  In-Reply-To: <5106EB91.1040107@ttc-cmc.net>
  References: <74B305A4-D481-4D4C-8E0E-8EBAB50CF584@highfleet.com> <5106C07B.8020800@ttc-cmc.net> <CADK3HHK9HgJ+-2x9cBMbH9VryUoNvTAbzcG1D+xgN9WR=05vEw@mail.gmail.com> <E67FF73D-0FCA-406A-A03B-BFB1398B9936@highfleet.com> <CADK3HHKv+_nhrHsw9T8ymt277FiyQ_x3jU95LE6ObGaD60Sm-Q@mail.gmail.com> <CADK3HHJrkvmLKcRtkOf6i_a1sk2+haewd-2NeuEgCNNz1AT11Q@mail.gmail.com> <1359406432.56292.YahooMailNeo@web162904.mail.bf1.yahoo.com> <5106E796.8070204@ttc-cmc.net> <CADK3HH+HzD_bQ00gLo4FcaXYsnsiLugBczGYdq2me=g=5T+RrQ@mail.gmail.com> <5106EB91.1040107@ttc-cmc.net>

* 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