Topic: JDBC数据集反复使用

  Print this page

1.JDBC数据集反复使用 Copy to clipboard
Posted by: HongShijin
Posted on: 2006-10-11 09:35

各位前辈好,我也算是初学者吧,请大侠赐教!
在RESULTSET中怎么对一记录的一列多次取值?我取一次后再取值就提示《空》错误。
我打开一个记录集(RESULTSET)后再打开就提示数据已关闭,怎么打开多个记录集对象?,

2.Re:JDBC数据集反复使用 [Re: HongShijin] Copy to clipboard
Posted by: lisliefor
Posted on: 2006-10-11 13:22

Set: rs is one object of ResultSet.
When you use the function rs.next() and get the value . If you have used one time , The pointer points at the next element .
Try to use rs.beforeFirst() so that the pointer is moved the above of the first element . Or try to use rs.absolute(int i) and move the pointer to the place where you want to.
Attention please , if you persist in using the function rs.next() , you should move the pointer to the previous element of your want.

HongShijin wrote:
我打开一个记录集(RESULTSET)后再打开就提示数据已关闭,怎么打开多个记录集对象?


What do you want to do ? I cannot understand ! Please show the details.
Maybe you want to do more operation about database at one time !
but it's unsafe ! How can you ensure that these operation are both right and are both excuted ! If one of your sql statement has some problems, the database will be mixed up !
Try to find some data about "事务"。

3.Re:JDBC数据集反复使用 [Re: HongShijin] Copy to clipboard
Posted by: HongShijin
Posted on: 2006-10-29 13:17

E文的不是很能看懂!
不好意思,谢谢。


   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923