java获取ResultSet记录行数 、 列数

Statement stmt = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
ResultSet rs = stmt.executeQuery(sql);

//获取ResultSet记录行数

rs.last();

int rowCount= rs.getRow();



//获取ResultSet记录列数

ResultSetMetaData rsmd = this.rs.getMetaData();

this.columnCount = rsmd.getColumnCount();


你可能感兴趣的:(java,sql,scroll)