Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

scrollable ResultSet advise



Hi, i am just migrating from 7.4 to 8.3, and i have this issue:
In the old 7.4 days i wrote a simple function to get the size of a ResultSet.
public static int FS(ResultSet rs) throws SQLException{	/* fetch size */
		rs.last();
		int cnt = rs.getRow();
		rs.beforeFirst();
		return cnt;
}

However, in plain connnection.prepareStatement(String sql) calls, ResultSet type defaults to FORWARD_ONLY,
making the above code broken.

I am wandering if there is a quick way to solve this problem, without touching the huge number of PreparedStatements
in the code.
Has anyone solved this problem using some kind of a wrapper, e.g. using wrapper classes from jboss?
-- 
Achilleas Mantzios



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group