No subject
Sat Nov 12 19:29:10 PST 2005
<snip>
Only one ResultSet per Statement can be open at any point in time.
Therefore, if the reading of one ResultSet is interleaved with the reading
of another, each must have been generated by different Statements. All
statement execute methods implicitly close a statment's current ResultSet if
an open one exists.
</snip>
Copy the results of your current resultset into a collections-type object
(Vector/Hashtable etc.) immediately before your obtaining your next
resultset so that you have a repository of known data that you can process
once your SQL statements have all gone through.
hth
Jayanth
----- Original Message -----
From: "Anil Colin Lobo" <anill at aztec.soft.net>
To: "Bill Littman" <blittman at tomotherapy.com>; "Advanced Java Mail List"
<advanced-java at xcf.berkeley.edu>
Sent: Friday, October 06, 2000 2:51 AM
Subject: RE: Can I have multiple PreparedStatements with 1 DB connection?
> Hi,
> The problem you have is weird but you can try this workaround:
> 1:Copy all the results from your first result set to an Object array and
> close the ResultSet.
> 2: Then iterate through all the items of your Object array to do your next
> PreparedStatement
>
> See if the problem goes away,
>
> HTH,
> Anil
>
> --------------------------------------------
> Anil Colin Lobo
> Aztec Software, Inc.
> 3211 Scott Blvd., Suite 204
> Santa Clara, California 95054
> Ph: (408) 7483500
> Web: http://www.aztecsoft.com
>
> -----Original Message-----
> From: Bill Littman [mailto:blittman at tomotherapy.com]
> Sent: Thursday, October 05, 2000 11:16 AM
> To: Anil Colin Lobo; Advanced Java Mail List
> Subject: Re: Can I have multiple PreparedStatements with 1 DB
> connection?
>
>
> Hi Anil-
>
> Thanks for your response.
>
> Here is what happens.
>
> After I return from my nested result set, I go and do a resultSet.next on
> the first resultSet. I get a SQLException thrown: Function sequence error.
>
> I use JBuilder and when I watch the internals of the first resultSet when
I
> step over the call to the second resultSet, there are some definite
changes.
>
> As far as there being problems in my code, that is very possible. I have
> created more bugs that I care to admit. However the corruption of the
first
> resultSet seems directly due to the executeQuery of a different
> PreparedStatement because: 1. My debugger session described above, and 2.
If
> I comment out the call to the method that executes the nested
> PreparedStatement, the problem vanishes.
>
> -Bill
>
>
>
> ---
> To unsubscribe, mail advanced-java-unsubscribe at xcf.berkeley.edu
> To get help, mail advanced-java-help at xcf.berkeley.edu
>
---
To unsubscribe, mail advanced-java-unsubscribe at xcf.berkeley.edu
To get help, mail advanced-java-help at xcf.berkeley.edu
More information about the Advanced-java
mailing list