• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Scott Selikoff
Bartenders:
  • Piet Souris
  • Jj Roberts
  • fred rosenberger

problem with resultset

 
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 158
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 1087
Oracle Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 1087
Oracle Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 1491
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Even you can set your number of rows thru CachedRowSet thru setMaxRows()
 
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic