Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How do I use the CacheRowSet?

 
John Riool
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to use CacheRowSet but am getting �javax.sql.rowset.CachedRowSet is abstract; cannot be instantiated� on this statement: CachedRowSet crs = new CachedRowSet();

How do I fix this? Do I need to import something other than javax.sql.rowset.* ?

Sample Code:
import java.sql.*;
import javax.sql.*;
import javax.sql.rowset.*;
.
.
.
CachedRowSet crs = new CachedRowSet();

I am using Java 2 Runtime Environment, Standard Edition (build 1.5.0_09-b03).
 
Michael Ku
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to use a class that extends CachedRowSet and is not abstract.
[ September 24, 2007: Message edited by: Michael Ku ]
 
John Riool
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do I find a class that extends CachedRowSet? I think it may be CachedRowSetImpl from com.sun.rowset.CachedRowSetImpl. But from what I can tell from searching Google, a class should be included in javax.sql.
 
Michael Ku
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
John, I remember that this was a hard class to find when I looked at it over a year ago. It appears that it is still hard to find the impl class. I cannot remember where I found it. Try searching Sun or Apache sites for an implementation of CachedRowSet.
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here's what I found: CachedRowSet. Fascinating reading; I've never looked into this before.
 
Michael Ku
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Stan, he needs an implementation of this class...
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
CachedRowSetImpl is referenced (but not linked) in the other doc. It's in rowset.jar in the RefrenceImplementation
 
Michael Ku
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Stan. I could not remember from where I downloaded it a few years aog. I think this is where I got it back then. Very BIG help
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic