I am a chinese student,i want to ask a JSP problem,ok?

I am a chinese student,i want to ask a JSP problem,ok?

the problem is:

ResultSet rs=null,rs2=null;

rs=cqpsql.query("select * from cqp_news_class where pid=0 order by sort_id");

rs2=cqpsql.query("select * from cqp_news_class where pid=2 order by sort_id");

i want to open 2 ResultSet (rs,rs2) in the same time,but i cannt,

It seams i just only can open one ResultSet in the same time,

anyone can help me?

[452 byte] By [andy_cqqppa] at [2007-11-27 2:41:14]
# 1

>I am a chinese student,i want to ask a JSP problem,ok?

NO.

>i want to open 2 ResultSet (rs,rs2) in the same time

You can't. Only one cursor could be used in the same time.

Suggestion:

1 - Open rs.

2 - Read it in a collection (java.util.ArrayList for example)

3 - close rs

4 - open rs2

5 - read it in a collection

...

hth

java_2006a at 2007-7-12 3:04:49 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
ni hao ma!!i don't think you open both at the same time, but you can open rs execute the query then start the rs2 then execute the query.IBut why you want to execute both at the same time.
G_Abubakra at 2007-7-12 3:04:49 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
Most likely you just need to merge the SQL queries to achieve the result you need.
BalusCa at 2007-7-12 3:04:49 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...