RE: getMoreResults() returns false incorrectly

From: Peter Mount <petermount(at)it(dot)maidstone(dot)gov(dot)uk>
To: "'Bob Kline'" <bkline(at)rksystems(dot)com>, pgsql-interfaces(at)postgresql(dot)org
Subject: RE: getMoreResults() returns false incorrectly
Date: 2000-06-26 07:46:21
Message-ID: 1B3D5E532D18D311861A00600865478CF1AF68@exchange1.nt.maidstone.gov.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

I'll look into this, as the psql example included with the source uses this
method in this way.

Peter

--
Peter Mount
Enterprise Support
Maidstone Borough Council
Any views stated are my own, and not those of Maidstone Borough Council

-----Original Message-----
From: Bob Kline [mailto:bkline(at)rksystems(dot)com]
Sent: Tuesday, June 20, 2000 11:25 AM
To: pgsql-interfaces(at)postgresql(dot)org
Subject: [INTERFACES] getMoreResults() returns false incorrectly

[Second submission; first seems to have disappeared.]

I tried to search the list archives, but the search engine appears to be
broken (comes back with an http 404 error).

Using the Postgresql JDBC driver (I'm testing with jdbc7.0-1.1.jar) it
appears that Statement.getMoreResults() returns false even if there is a
result set from the query just executed.

Statement stmt = conn.createStatement();
stmt.execute("SELECT * FROM t");
if (stmt.getMoreResults()) {
ResultSet rs = stmt.getResultSet();
while (rs.next()) {
// process row ....
}
}

The call to getMoreResults() returns false consistently. If the call is
replaced with 'if (true) ...' then the code to get the result set and
process the rows works fine.

Accoring to the JDBC docs, this method should return "true if the next
result is a ResultSet; false if it is an update count or there are no
more results." There is no update count (as confirmed by
getUpdateCount()).

Is this a known problem? If this method doesn't work as documented,
it's impossible to "work with an unknown SQL string" as the
documentation for execute() indicates we should be able to (without
parsing the SQL query).

--
Bob Kline
mailto:bkline(at)rksystems(dot)com
http://www.rksystems.com

Responses

Browse pgsql-interfaces by date

  From Date Subject
Next Message Peter Mount 2000-06-26 08:02:43 RE: Postgres JDBC driver : problem with timestamps.
Previous Message Byron Nikolaidis 2000-06-25 19:46:43 Re: How to use question mark in query thru ODBC from Windows