展开全部
先rs.last(),跳到最后一行,然后获得的行数就是查询集的行数,在rs.beforefirst()
int row;
int col;
stmt = conn.prepareStatement( SQL ,ResultSet.
TYPE_SCROLL_INSENSITIVE,
ResultSet.CONCUR_READ_ONLY);
rs = stmt.executeQuery();
if( rs.last())
{
row = rs.getRow();
rs.beforeFirst();
}
int col = rs.getMetaData().getColumnCount();
int row;
int col;
stmt = conn.prepareStatement( SQL ,ResultSet.
TYPE_SCROLL_INSENSITIVE,
ResultSet.CONCUR_READ_ONLY);
rs = stmt.executeQuery();
if( rs.last())
{
row = rs.getRow();
rs.beforeFirst();
}
int col = rs.getMetaData().getColumnCount();
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询