Re: Bug found in the driver - Mailing list pgsql-jdbc

From Barry Lind
Subject Re: Bug found in the driver
Date
Msg-id 3B72016E.5060806@xythos.com
Whole thread Raw
In response to Re: Bug found in the driver  (Denis Bucher <dbucher@niftycom.com>)
Responses Re: Bug found in the driver
List pgsql-jdbc
I can't reproduce this error with a 1.3.1 JDK and the 7.1.2 driver.
When disabling access through pg_hba.conf I get the following correct
error with the {0} filled in by the exception information:

Something unusual has occured to cause the driver to fail. Please report
this exception: Exception: java.sql.SQLException: No pg_hba.conf entry
for host 127.0.0.1, user blind, database xythos3
Stack Trace:

java.sql.SQLException: No pg_hba.conf entry for host 127.0.0.1, user
blind, database xythos3
    at org.postgresql.Connection.openConnection(Connection.java:170)
    at org.postgresql.Driver.connect(Driver.java:122)
    at java.sql.DriverManager.getConnection(DriverManager.java:517)
...


thanks,
--Barry



Denis Bucher wrote:
> At 22:01 03.08.01 +0200, you wrote:
>
> Hello !
>
>> On Fri, 03 Aug 2001 15:06:46 +0200, Denis Bucher wrote:
>> >I've FOUND A BUG in the postgres JDBC driver !
>>
>> OK, please help us fix it.
>>
>> >If you want to see the source online :
>> >http://cs.baylor.edu/~speegle/5335/org/postgresql/
>> >
>> >Please look at Driver.class :
>> >
>> >     } catch(Exception ex2) {
>> >         throw new PSQLException("postgresql.unusual",ex2);
>> >
>> >But it doesn't print the exception ex2 !!!
>>
>> This code is not supposed to print an exception. Please be more
>> specific. What are you doing exactly? Why are we looking at this
>> particular line of source code? What exception did you expect?
>> Why did you expect it to be printed?
>
>
> Ok, this line prints the following message :
>
> Quelque chose de peu commun s'est produit pour faire ?échouer le
> gestionnaire. Veuillez enregistrer cette exception: {0}
>
> which is the french version of :
>
> Something unusual has occured to cause the driver to fail.
> Please report this exception: {0}
>
> BUT it doesn't print the exception between '{' and '}' which makes
> VERY hard to debug the problem. I found LOTS of emails in
> mailing-lists only due to this problem : If the exception was
> printed, people wouldn't have asked because they would have
> seen "this host is not present in hba_conf", or something like
> that. With my 'kludge-correction' it PRINTS the EXACT exception
> that made the driver fail :
>
> throw new PSQLException("postgresql.unusual: " + ex2);
>
> But I know my correction isn't 'clean' because it circumvents the
> PSQLException method that IMHO SHOULD print out the exception,
> or else why the hell would there be that message "please report this
> exception : {0}" AND why whould 'ex2' be mentionned ?
>
> Denis
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
>



pgsql-jdbc by date:

Previous
From: Rene Pijlman
Date:
Subject: Re: Re: JDBC 2.0 conformance, documentation and todo list
Next
From: Barry Lind
Date:
Subject: Re: JDBC 2.0 conformance, documentation and todo list