String sql = "select distinct student_name from " + tableName;//tableName表示是我表名
ResultSet rs = stmt.executeQuery(sql);
CachedRowSetImpl rowSet = new CachedRowSetImpl();// 创建行集对象
rowSet.populate(rs);
当运行到rowSet.populate(rs);时就错误,说游标错误。
当我将SQL语句改为
String sql = "select student_name from " + tableName;即不要distinct时就运行正确,请问这是什么问题呢??
用CachedRowSetImpl需要对SQL语句有什么限制吗,是不是distinct这些关键字不能用这里面??