Re: Driver.acceptsURL(String) not working correctly

From: Kris Jurka <books(at)ejurka(dot)com>
To: Garrick Dasbach <Garrick(at)musicrebellion(dot)com>
Cc: <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Driver.acceptsURL(String) not working correctly
Date: 2003-11-03 10:47:42
Message-ID: Pine.LNX.4.33.0311030545260.29431-300000@leary.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On Fri, 22 Aug 2003, Garrick Dasbach wrote:

> I'm currently writing an application which allows a user to enter a JDBC
> connection string, and I make a connection using that string and the
> drivers available to me. While working with the Postgresql driver, our
> primary database, I noticed that the acceptsURL() function of the JDBC
> driver does not function correctly.
>
> This is my test code:
>
> Driver driver = // Driver Initialization
> if(driver.acceptsURL("blah")){
> // report good news
> } else {
> // fail to user
> }
>
> I should recieve a failure, resulting in a dialog popup to the user.
> However acceptsURL returns true in this case.

Here is a patch that fixes this. Also it corrects the comments describing
the protocol string to say jdbc:postgresql: instead of
jdbc:org.postgresql:

Also I've added this test case and another for IPv6 addresses to the
acceptsURL regression test.

Kris Jurka

Attachment Content-Type Size
acceptsurl_test.patch text/plain 1.0 KB
acceptsurl_fix.patch text/plain 2.9 KB

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Dave Cramer 2003-11-03 14:02:25 Re: A bug in 7.3 jdbc driver now support for PG money type
Previous Message Kris Jurka 2003-11-03 10:25:31 Re: JDBC getImortedKeys() getExportedKeys() incorrect ON