jdbc driver, error trapping.

From: "Matthew Taylor" <bmatthewtaylor(at)hotmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: jdbc driver, error trapping.
Date: 2001-01-24 12:08:14
Message-ID: F214VjCRGryWtIIZS2T00001f13@hotmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-jdbc

I might have missed the obvious, but currently having the following
behaviour.

If I run the following java code,

try{
ResultSet rs = stmt.executeQuery("select blah from blah");
while(rs.next())
{
System.out.println("result = "+rs.getString("blah") );
}
rs.close();
}catch (Exception ex)
{
System.out.println("error="+ex.toString() );
}

on a table that has NO records in it, I get an error thrown 'No results were
returned by the query'. I would like to keep the try catch blocks since

1. I am converting from Oracle backend which works fine otherwise.
2. some of my sql is dynamically generated, hence the try catch normally
only picks up bad sql.

any suggestions?? It's late and I'm prol not thinking straight...

(ps: using postgresql-7.0.-3, jdk1.1.8, postgresql-jdbc-7.0-3 installed via
rpm's.)
Mat.

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2001-01-24 12:15:53 Re: PostgreSQL: Introduction and Concepts by Bruce Momjian
Previous Message Vince Vielhaber 2001-01-24 11:59:18 Re: PostgreSQL: Introduction and Concepts by Bruce Momjian

Browse pgsql-jdbc by date

  From Date Subject
Next Message Bruce Momjian 2001-01-24 13:54:50 Open items
Previous Message Michael Stephenson 2001-01-24 11:35:57 Re: Postgresql JDBC driver - Support for Scrollable Result Sets