permaculture playing cards*
The moose likes JDBC and the fly likes CachedRowSet implementation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "CachedRowSet implementation" Watch "CachedRowSet implementation" New topic
Author

CachedRowSet implementation

Juanjo Bazan
Ranch Hand

Joined: Feb 04, 2002
Posts: 231
Hi ranchers!
I've just download the jdk 1.4.1_01, and it do not provide any implmentation of the RowSet class (in the javax.sql package).
Some time ago I read at the sun's early access page an article about some disconnected implementations of RowSet like CachedRowSet.
In it they talk about those classes as a extension to jdbc 2.0, as if it would be natural to include them in the JDBC 3.0...
Even in the JDBC 2.0 API Tutorial and Reference you can read: (quote)"the Java Software division of Sun Microsystems, Inc., plans to provide reference implementations for three different styles of rowsets in the future"
AFAIK they have been never included in any jdk release -I mean in the 'official' javax.sql package, not in a vendor specific product(I know Orion has a CachedRowSet and the sun.jdbs.rowset classes come with Forte CE).
Do you know why??
Any disadvantage about them?
Do you have negative experiences using that classes??
Does anybody know if the CachedRowSet class will be included in a jdk soon?
Thanx
[ January 07, 2003: Message edited by: Juanjo Bazan ]
Basil Bourque
Greenhorn

Joined: Dec 30, 2003
Posts: 7

The RowSet interfaces, including CachedRowSet, are indeed bundled in Java 5, 6, and 7.

CachedRowSet doc:
http://download.oracle.com/javase/7/docs/api/index.html?javax/sql/rowset/package-summary.html

Sun did indeed release their promised standard implementation of CachedRowSet, called "com.sun.rowset.CachedRowSetImpl". Now made available by Oracle:
http://download.oracle.com/docs/cd/E17824_01/dsc_docs/docs/jscreator/apis/rowset/com/sun/rowset/CachedRowSetImpl.html

I find that Sun implementation bundled in Apple's Java 6 on Mac OS X 10.6.8 (Snow Leopard).

Oracle's JDK 6u23 source code has these implementations:
• com.sun.rowset.CachedRowSetImpl
• com.sun.rowset.FilteredRowSetImpl
• com.sun.rowset.JdbcRowSetImpl
• com.sun.rowset.JoinRowSetImpl
• com.sun.rowset.WebRowSetImpl

Furthermore, some vendors release their own implementations. I've seen references to implementations from Oracle specific to their database products.

--Basil Bourque

Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19649
    
  18

You shouldn't use those classes since they are for JVM internal use only, and may be changed or removed from one Java version to another. That means that code that's working right now may not work anymore when you update your Java installation. This is true for all classes in packages that start with sun, sunw or com.sun.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Basil Bourque
Greenhorn

Joined: Dec 30, 2003
Posts: 7

Rob Spoor wrote:You shouldn't use those classes since they are for JVM internal use only,


You are incorrect; those classes are not for JVM internal use only. Quite the opposite.

These sun.* classes are the official reference implementations of RowSet interfaces. They are meant to be used by developers, as explained in the RowSet documentation:
The reference implementation of the CachedRowSet interface provided by Oracle Corporation is a standard implementation. Developers may use this implementation just as it is, they may extend it, or they may choose to write their own…


Rob Spoor wrote:… those classes … may be changed or removed from one Java version to another. That means that code that's working right now may not work anymore when you update your Java installation. This is true for all classes in packages that start with sun, sunw or com.sun.


You are correct about this. Every developer should understand that the sun.* classes are not part of the official Java platform. They are not included in every Java implementation. However, they have been bundled in Sun/Oracle's implementations released by themselves as well as their licensees such as Apple, Inc. for Mac OS X. This bundling continues in Java 5, 6, and 7. Read Oracle's official statement.

While we developers should be aware that Oracle retains the legal right to withdraw the sun.* classes, to say that we should never use them is an overstatement. Especially so when discussing the official reference implementations.

--Basil Bourque

Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19649
    
  18

But what if you use a JVM that's not written by Oracle? That will quite possibly be missing the sun.* classes, and your code will not work on it.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: CachedRowSet implementation
 
Similar Threads
Populating RowSet with another RowSet
CachedRowSet - Can't get an instance
hey , RowSet interface ?
Can't find CachedRowSet into javax.sql
Please Help: CachedRowSetImpl (JSR-114) with Oracle Type4 Driver