jsp查询Access数据库setFetchDirection问题,在线等!!!!!

hanhongmin 2006-02-23 06:35:23
setFetchDirection
void setFetchDirection(int direction)
throws SQLExceptionGives the driver a hint as to the direction in which rows will be processed in ResultSet objects created using this Statement object. The default value is ResultSet.FETCH_FORWARD.
Note that this method sets the default fetch direction for result sets generated by this Statement object. Each result set has its own methods for getting and setting its own fetch direction.


Parameters:
direction - the initial direction for processing rows
Throws:
SQLException - if a database access error occurs or the given direction is not one of ResultSet.FETCH_FORWARD, ResultSet.FETCH_REVERSE, or ResultSet.FETCH_UNKNOWN
Since:
1.2
See Also:
getFetchDirection()
以上是setFetchDirection文档
我在查询数据库时需要一列一列地查,不知道怎么能改指针还是游标位置什么的
rs.beforeFirst();
rs.first();
都不行
不管stmt.setFetchDirection怎样设置总是返回java.sql.SQLException: Result set type is TYPE_FORWARD_ONLY
这是怎么回事?该怎样解决?本人新手..
...全文
83 点赞 收藏 4
写回复
4 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
hanhongmin 2006-02-27
还有没有人来呀?
叫我怎么结帖阿!!
回复
infowain 2006-02-24
Result set type is TYPE_FORWARD_ONLY
你打开的数据集游标是forward_only的,也就是说,只能顺序fetch的
回复
changechange 2006-02-24
在 REORDSET.OPEN 的时候有一个游标参数,类似

rs.open("strsql",adodb.connection,2,3)

回复
hanhongmin 2006-02-24
...不明白
我以前用vb可以呀,现在想改成jsp的
回复
相关推荐
发帖
Web 开发
创建于2007-09-28

8.0w+

社区成员

Java Web 开发
申请成为版主
帖子事件
创建了帖子
2006-02-23 06:35
社区公告
暂无公告