Skip site navigation (1) Skip section navigation (2)

getMoreResults() returns false incorrectly

From: Bob Kline <bkline(at)rksystems(dot)com>
To: pgsql-interfaces(at)postgresql(dot)org
Subject: getMoreResults() returns false incorrectly
Date: 2000-06-20 10:25:15
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-interfaces
[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 ( {
            // 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

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

pgsql-interfaces by date

Next:From: Bob KlineDate: 2000-06-20 15:08:27
Subject: Re: getMoreResults() returns false incorrectly
Previous:From: Byron NikolaidisDate: 2000-06-19 23:18:54
Subject: Re: Simple Q: Does the ODBC driver support LONGVARCHAR?

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group