AppletTalk.com Forum Index AppletTalk.com
Java discussions newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

new hsqldb user with a problem

 
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java and Databases
View previous topic :: View next topic  
Author Message
Manolis Christodoulou
Guest





PostPosted: Mon Jan 05, 2004 11:05 pm    Post subject: new hsqldb user with a problem Reply with 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
Markku Salminen
Guest





PostPosted: Tue Jan 06, 2004 12:02 am    Post subject: Re: new hsqldb user with a problem Reply with quote



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
Display posts from previous:   
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java and Databases All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.