From: | Dave Cramer <Dave(at)micro-automation(dot)net> |
---|---|
To: | Karl Goldstein <karlgold(at)yahoo(dot)com> |
Cc: | "pgsql-jdbc(at)postgresql(dot)org" <pgsql-jdbc(at)postgresql(dot)org> |
Subject: | Re: |
Date: | 2002-11-04 17:18:56 |
Message-ID: | 1036430337.1716.415.camel@inspiron.cramers |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-jdbc |
Karl,
Can you send us a small test case which replicates the problem?
Dave
On Mon, 2002-11-04 at 12:05, Karl Goldstein wrote:
> Hello,
>
> I am having a problem with queries that return empty result sets. Whenever
> I execute a query that returns no rows, the driver throws a SQLException:
>
> No results were returned by the query.
> at
> org.postgresql.jdbc1.AbstractJdbc1Statement.executeQuery(AbstractJdbc1Statem
> ent.java:157)
> at
> org.postgresql.jdbc1.AbstractJdbc1Statement.executeQuery(AbstractJdbc1Statem
> ent.java:141)
>
> I'm assuming this is not the intended behavior, since it's perfectly
> reasonable for a query to return an empty result set.
>
> Looking at the source code for AbstractJdbc1Statement and working backwards,
> the following seems to be happening:
>
> 1) executeQuery() starts looping over the current results until it finds one
> that is "really" a result set
> 2) either AbstractJdbc1ResultSet.getNext() never returns a non-null result,
> or AbstractJdbc1ResultSet.reallyResultSet() never returns true (I didn't
> track it down that far).
> 3) looking at AbstractJdbc1ResultSet.getNext(), it simply returns the next
> member variable
> 4) I didn't track down where the AbstractJdbc1ResultSet.next() method is
> called, but this statement on line 65 caught my eye:
>
> if (++current_row >= rows.size())
> return false;
>
> However, I'm not sure this is related at all since the "next" member
> variable gets set by the append(), and I didn't track down where that is
> called.
>
> Any advice on this would be appreciated.
>
> Thanks
>
> Karl
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly
>
>
From | Date | Subject | |
---|---|---|---|
Next Message | Andrew Sullivan | 2002-11-04 17:24:06 | Re: jbuilder and timestamps |
Previous Message | Karl Goldstein | 2002-11-04 17:05:52 |