use
information_schema
select
table_name,table_rows
from
tables
where
TABLE_SCHEMA
=
'数据库名'
order
by
table_rows
desc
有两种方式1.通过sql语句:
如select count(id) from tab where id<10
这样查出来的就是行数
2. 在java中
//sqlRst是ResultSet 对象的实例
int RowCount = sqlRst.getRow()//获得当前行号
var selectedRowvar tempCount
var rCount
tempCount=1000
selectedRow=dg.selectedindex
dg.selectedindex=tempCount
rCount=dg.selectedindex+1
dg.selectedindex=selectedRow
rCount就是总行数,因为Index是从0开始的,故此要加一。
tempCount设置是一个默认比行数多的数
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)