我正在使用 ucanaccess 将 java 与 access 数据库连接。 我使用此代码来计算查询中的行数:
ResultSet rs = s.getResultSet();
int size;
rs.last();
size = rs.getRow();
但它显示了这个异常
net.ucanaccess.jdbc.UcanaccessSQLException: feature not supported
at net.ucanaccess.jdbc.UcanaccessResultSet.last(UcanaccessResultSet.java:903)
还有其他方法可以获取 ucanaccess 中的行数吗?....
最佳答案
您的结果集不可滚动。 您应该使用:
Statement stat = super.ucanaccess.createStatement(
ResultSet.TYPE_SCROLL_INSENSITIVE,
ResultSet.CONCUR_READ_ONLY
);
为了调用 rs.last();
你的问题问错了。请引用JDBC官方文档。
关于java - 如何使用 ucanaccess 获取查询中的行数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31343448/