On Oct 29, 6:34 pm, Martin wrote:
> I'm upgrading legacy system using java 1.4, MS SQL 2000, and Jturbo
> 3.0.2 to MS SQL 2005 and jTDS 1.2.2. While testing I found 'Invalid
> State: Result Set already closed'. Found a number of multiple
> resultsets tied to a single statement:
>
> rs1 = stmt1.executeQuery(sql1);
> rs2 = stmt1.executeQuery(sql2);
> rs3 = stmt1.executeQuery(sql3);
> while(rs1.next()) {...}
> while(rs2.next()) {...}
> while(rs3.next()) {...}
> stmt1.close();
>
> 1) I've seen jturbo mention multiple resultsets from a single
> statement but not sure if this refers to the code above or callable
> statements?
> 2) jTds mentioned some changes to allow this functionality
> (Metadata::supportMultipleResultSets), does this refer to this or
> multiple resultsets from a single statement single query?
> 3) Is it possible to get this working with jtds? Right now I'm
> fixing by adding statements for each resultsets but its slow and would
> like to avoid going to jTurbo 2005.
>
> Thanks,
>
> Martin
The JDBC spec mandates that any re-execution of a statement
will automatically close any currently existing result set from that
statement. If some driver chooses to implement it differently then
follow their instructions.
HTH,
Joe Weinstein
>> Stay informed about: Multiple resultsets in jturbo and jtds