Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Tzw99-0007z8-Sy for pgsql-jdbc@arkaria.postgresql.org; Mon, 28 Jan 2013 21:21:44 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1Tzw99-0008V4-Ct for pgsql-jdbc@arkaria.postgresql.org; Mon, 28 Jan 2013 21:21:43 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Tzw98-0008Uw-IR for pgsql-jdbc@postgresql.org; Mon, 28 Jan 2013 21:21:42 +0000 Received: from outbound.vnet-inc.com ([216.146.104.103]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Tzw94-0004ec-9Y for pgsql-jdbc@postgresql.org; Mon, 28 Jan 2013 21:21:41 +0000 Received: from [192.168.157.132] (unknown [76.75.27.41]) by outbound.vnet-inc.com (Postfix) with ESMTP id 44D2D5A63; Mon, 28 Jan 2013 14:21:38 -0700 (MST) Message-ID: <5106EB91.1040107@ttc-cmc.net> Date: Mon, 28 Jan 2013 14:20:17 -0700 From: dmp User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.13) Gecko/20100914 SeaMonkey/2.0.8 MIME-Version: 1.0 To: Dave Cramer , pgsql-jdbc@postgresql.org Subject: Re: Bug report: NullPointerException from Driver.connect when passed a Properties with non-string values References: <74B305A4-D481-4D4C-8E0E-8EBAB50CF584@highfleet.com> <5106C07B.8020800@ttc-cmc.net> <1359406432.56292.YahooMailNeo@web162904.mail.bf1.yahoo.com> <5106E796.8070204@ttc-cmc.net> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-jdbc Precedence: bulk Sender: pgsql-jdbc-owner@postgresql.org 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 > 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> 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 > > > -- Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-jdbc