When migrating our project to Java 11, we are getting this error related to our use of RowSet technology (see Tutorial).
java: cannot access com.sun.rowset.CachedRowSetImpl
class file for com.sun.rowset.CachedRowSetImpl not found.
java: incompatible types: com.sun.rowset.CachedRowSetImpl cannot be converted to java.sql.ResultSet
I came to know in Java 11, com.sun packages are not accessible.
How can I solve this?
You should use RowSetProvider to get a factory.
RowSetFactory aFactory = RowSetProvider.newFactory();
CachedRowSet crs = aFactory.createCachedRowSet();
From the Javadoc:
A factory API that enables applications to obtain a
RowSetFactoryimplementation that can be used to create different types ofRowSetimplementations.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With