• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem with resultset

 
sitaram irrinki
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the limit of ResultSet interface in java.sql,i.e how many
table of data it can hold.And what is alternative to ResultSet which can hold more table of data
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A resultSet can hold the data of only one table*. Better say it like, a resultSet can hold the result of only one query, a query may include more than on table.

*Table may be created and filled on the fly.

I think you want to ask, how many rows it can hold? right?
 
Anand Karia
Ranch Hand
Posts: 156
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A resultSet holds a single query. But a single query could comprise of number of tables with multiple conditions.
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Anand Karia:
A resultSet holds a single query. But a single query could comprise of number of tables with multiple conditions.


Ok, my language was not that much good.
 
Shailesh Chandra
Ranch Hand
Posts: 1082
Java Oracle Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In addtion to all above I want to add this but I am not very sure about this and need inputs of other.

In my view
ResultSet does not hold any data rather It points to cursor in database and it makes a round trip to database whenever resultset.next() is called so there is no limit of resulset if there is any then it would be DB dependant


what is alternative to ResultSet which can hold more table of data

As far as I know there is no alternative of ResultSet even if you use CachedRowSet then also you need resultSet to populate it.

Shailesh
[ April 16, 2005: Message edited by: Shailesh Chandra ]
 
vasu devan
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

Reslutset can have anynumber,kinds of data but its purely based on the Query ,so query may contain any number of tables.

So here each recordset pointer moves from one record to another recordset with next()

cheers
vasu
 
Shailesh Chandra
Ranch Hand
Posts: 1082
Java Oracle Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
finally I got one statement to validate my sentence


Standard JDBC receives the result sets of queries one row at a time. Each row costs a round trip to the database. This feature associates with each statement object an integer called its row prefetch setting. JDBC fetches that number of rows at a time from result sets associated with the statement.



Shailesh
 
kri shan
Ranch Hand
Posts: 1479
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Even you can set your number of rows thru CachedRowSet thru setMaxRows()
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic