| View previous topic :: View next topic |
| Author |
Message |
Manolis Christodoulou Guest
|
Posted: Mon Jan 05, 2004 11:05 pm Post subject: new hsqldb user with a problem |
|
|
I have a problem using HSQLDB 1.7.1
Here is the code after creating a connection and a statement...
ResultSet rs=some_statement.executeQuery(some_query_string);
System.out.println(rs.getRow());
/* This prints 0 - as is expected */
rs.last();
System.out.println(rs.getRow());
/* This prints 22 - as is expected */
rs.first();
System.out.println(rs.getRow());
/* This does not print 1 as I would expect but 22 */
Which means that HSQLDB ResultSets do not go backwards.
Any solution please?
|
|
| Back to top |
|
 |
Markku Salminen Guest
|
Posted: Tue Jan 06, 2004 12:02 am Post subject: Re: new hsqldb user with a problem |
|
|
Check java.sql API at http://java.sun.com/j2se/1.4.2/docs/api/
"A default ResultSet object is not updatable and has a cursor that moves
forward only." Then you can try (or read database docs) if it can
manage with scrollable recordsets.
Statement stmt = con.createStatement(
ResultSet.TYPE_SCROLL_INSENSITIVE,
ResultSet.CONCUR_UPDATABLE);
Manolis Christodoulou wrote:
| Quote: | I have a problem using HSQLDB 1.7.1
Here is the code after creating a connection and a statement...
ResultSet rs=some_statement.executeQuery(some_query_string);
System.out.println(rs.getRow());
/* This prints 0 - as is expected */
rs.last();
System.out.println(rs.getRow());
/* This prints 22 - as is expected */
rs.first();
System.out.println(rs.getRow());
/* This does not print 1 as I would expect but 22 */
Which means that HSQLDB ResultSets do not go backwards.
Any solution please?
|
|
|
| Back to top |
|
 |
|