Re: BUG #2636: JDBC error behaviour incorrect

From: Kris Jurka <books(at)ejurka(dot)com>
To: Kiren Pillay <kiren(dot)pillay(at)standardbank(dot)co(dot)za>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #2636: JDBC error behaviour incorrect
Date: 2006-09-26 07:09:05
Message-ID: Pine.BSO.4.63.0609260205330.22849@leary2.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Mon, 18 Sep 2006, Kiren Pillay wrote:

> The following bug has been logged online:
>
> Bug reference: 2636
> PostgreSQL version: 8.1.4
> Operating system: Windows
> Description: JDBC error behaviour incorrect
> Details:
>
> try {
> DBActions db=DBActions.getInstance();
>
>
> rs = db.getConnection().prepareCall(loadApplicationParameters
> ).executeQuery();
> while (rs.next()) {
> // Testing
> values.put(rs.getString(1), rs.getString(2));
> System.out.println(rs.getString(1)+","+ rs.getString(2));
> }
> } catch (SQLException sqle) {
> logger.error("Could not load application parameters ", sqle);
> }
> catch (Exception e){
> e.printStackTrace();
> }
> catch (Throwable e){
> e.printStackTrace();
> }
> /*finally {
>
> DBConnection.close(rs, ps);
> }*/
>
>
> In this code, the program gets to the executeQuery part with no exception.
> When it gets to the rs.next() part, the code jumps to the finally block.
> This is non-deterministic behaviour as the code seems to have thrown an
> exception, but even the catch Throwable part does not catch the error.

Isn't it just likely that rs.next() returned false?

> The database being connected to is a restore from another database. The fact
> is this database restore could be incorrect, but how can I find the actual
> error
> cause of the problem. Is there a way to increase the logging so that I can
> figure out the problem here.

The driver can be started given a URL connection parameter ?loglevel=2
that will print out a fair amount of protocol information.

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Ted Petrosky 2006-09-26 11:54:09 BUG #2653: failed to make
Previous Message Kris Jurka 2006-09-26 07:03:33 Re: BUG #2628: jdbc2