【问题标题】:How do I get the number of rows in a query using ucanaccess如何使用 ucanaccess 获取查询中的行数
【发布时间】:2015-07-10 14:32:45
【问题描述】:

我正在使用 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 中的行数吗?....

【问题讨论】:

    标签: java jquery database ucanaccess


    【解决方案1】:

    您的结果集不可滚动。 你应该使用:

    Statement stat = super.ucanaccess.createStatement(
                             ResultSet.TYPE_SCROLL_INSENSITIVE,
                            ResultSet.CONCUR_READ_ONLY
                            );
    

    为了调用 rs.last();

    你的问题放错地方了。请参考 JDBC 官方文档。

    【讨论】:

      猜你喜欢
      • 2011-09-15
      • 1970-01-01
      • 1970-01-01
      • 2012-10-29
      • 1970-01-01
      • 2016-04-18
      • 1970-01-01
      • 2021-01-08
      • 2010-09-26
      相关资源
      最近更新 更多