ResultSet问题?
请问得到一个ResultSet的长度的方法是什么?是getsize吗? 问题点数:0、回复次数:5Top
1 楼XKP(低等下人)回复于 2003-06-04 14:00:20 得分 0
rs.last()
rs.getRow()Top
2 楼xutao1981(虚心接受)回复于 2003-06-04 14:12:58 得分 0
楼上说的不全
还应该在con.createStatement(加参数);
用sql语句:
select count(*)from 表名
就可以了Top
3 楼shaokun305(好好学习,天天向上。)回复于 2003-06-04 14:57:59 得分 0
用Statement的getMaxRows()返回结果集合中的当前包含的最大行数/
getMaxFieldSize()和 SetMaxFieldSize()分别返回和设置结果集合中的组大字段长度Top
4 楼XKP(低等下人)回复于 2003-06-04 16:26:39 得分 0
Statement stmt = con.createStatement(
ResultSet.TYPE_SCROLL_INSENSITIVE,
ResultSet.CONCUR_UPDATABLE);
ResultSet rs = stmt.executeQuery("SELECT a, b FROM TABLE2");
Top
5 楼XKP(低等下人)回复于 2003-06-04 16:27:35 得分 0
用Statement的getMaxRows()返回结果集合中的当前包含的最大行数/
getMaxFieldSize()和 SetMaxFieldSize()分别返回和设置结果集合中的组大字段长度
public int getMaxRows()
throws SQLException
Retrieves the maximum number of rows that a ResultSet object produced by this Statement object can contain. If this limit is exceeded, the excess rows are silently dropped.
Returns:
the current maximum number of rows for a ResultSet object produced by this Statement object; zero means there is no limit
好像说的不是那个意思Top




