• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

CachedRowSet

 
kri shan
Ranch Hand
Posts: 1473
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using Oracle 9i DB. I would like to access some bulk data. So can i use JDBC's CachedRowSet for getting bulk data from the db, instead of hitting DB everytime.
 
kri shan
Ranch Hand
Posts: 1473
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any reply???
 
Shailesh Chandra
Ranch Hand
Posts: 1082
Java Oracle Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you try google ?


Disadvantage

1. As all the table rows are taken into memory, care should be taken with the query which retrieves the number of rows, as it will be very resourceful if huge set of rows is taken and the application will get very slow.

2. As rowsets will keep a connection to itself , hence the connection object will be kept at the client which make the client heavy.As it can modify data at the client side inconsistancy may arise with the server containing actual data.


Advantages :

1. Certain implementations of rowset doesn't require the database connection to be maintained throughout the entire period of time it takes to process the data. So even if DB connection is lost in between it works all right. It makes a connection while finally inserting the processed (modified) data. Precisely it need to make the connection only twice once while reading and second while updating after processing is over.While in jdbc resultsets which need to hold the DB connection throughout its usage which might not be possible in many practical cases.

2.Since it reads a set of rows from the table and loads it into memory, processes it in the memory and finally inserts the modified data into the DB, it is obviously much faster than resultsets which refer to the db for each row read.

3.Since the rowset object contains the DB connection information all by itself, (No connection object or statement object ), Rowsets make it easy to send tabular data over a network, whereby if we sendf the Rowset object over the network it suffices and there isn't any need to provide the DB information separately.

4. RowSet object follows the JavaBeans model for properties and event notification, it is a JavaBeans component that can be combined with other components in an application.


Hope this answers your query

Shailesh
[ April 07, 2005: Message edited by: Shailesh Chandra ]
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use TO/VO (Transfer Object/Value Object) instead.
 
kri shan
Ranch Hand
Posts: 1473
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can i use To/VO?? any samples...
 
Shailesh Chandra
Ranch Hand
Posts: 1082
Java Oracle Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are a lot of example on web.These are design patterns
see here detail of transfer object


Shailesh
[ April 08, 2005: Message edited by: Shailesh Chandra ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic