Java开发网 Java开发网
注册 | 登录 | 帮助 | 搜索 | 排行榜 | 发帖统计  

您没有登录

» Java开发网 » Database/JDBC/SQL/JDO/Hibernate  

按打印兼容模式打印这个话题 打印话题    把这个话题寄给朋友 寄给朋友    该主题的所有更新都将Email到你的邮箱 订阅主题
flat modethreaded modego to previous topicgo to next topicgo to back
作者 JDBC数据集反复使用
HongShijin





发贴: 3
积分: 0
于 2006-10-11 09:35 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
各位前辈好,我也算是初学者吧,请大侠赐教!
在RESULTSET中怎么对一记录的一列多次取值?我取一次后再取值就提示《空》错误。
我打开一个记录集(RESULTSET)后再打开就提示数据已关闭,怎么打开多个记录集对象?,



作者 Re:JDBC数据集反复使用 [Re:HongShijin]
lisliefor





发贴: 287
积分: 7
于 2006-10-11 13:22 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
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 "事务"。


lisliefor edited on 2006-10-11 13:28

作者 Re:JDBC数据集反复使用 [Re:HongShijin]
HongShijin





发贴: 3
积分: 0
于 2006-10-29 13:17 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
E文的不是很能看懂!
不好意思,谢谢。




flat modethreaded modego to previous topicgo to next topicgo to back
  已读帖子
  新的帖子
  被删除的帖子
Jump to the top of page

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