R
Rpng123
I need to get a count of records from an Access mdb. My program connects to
Access OK via JDBC. I do the Class.ForName(driver) thing, Connection, etc.
then Statement stmt = con.createStatement(); ResultSet rs =
stmt.executeQuery(sql);
Then I try rs.last(); so that I can say int recCount = rs.getRow();
But I keep getting a SqlException error - Result set type is TYPE_FORWARD_ONLY.
I have tried rs.setFetchDirection(FETCH_FORWARD) but I guess FETCH_FORWARD is
not a known Java constant. Is there way to get the recordcount without having
to loop through the entire table?
While(rs.next())
recCount = rs.getRow();
I would like to avoid this because some of my tables are quite large.
Thanks,
Rich
Access OK via JDBC. I do the Class.ForName(driver) thing, Connection, etc.
then Statement stmt = con.createStatement(); ResultSet rs =
stmt.executeQuery(sql);
Then I try rs.last(); so that I can say int recCount = rs.getRow();
But I keep getting a SqlException error - Result set type is TYPE_FORWARD_ONLY.
I have tried rs.setFetchDirection(FETCH_FORWARD) but I guess FETCH_FORWARD is
not a known Java constant. Is there way to get the recordcount without having
to loop through the entire table?
While(rs.next())
recCount = rs.getRow();
I would like to avoid this because some of my tables are quite large.
Thanks,
Rich