0

In my textbook on a chapter on Advanced Java Databse programming they use

Rowset rs = new JdbcRowSetImpl();

I've been struggling to try to find out how to use the com.sun package. They do not mention how to use this package. Anyone knows where I can download the Jar file for this package?

korpe
  • 83
  • 1
  • 8
  • The `com.sun.rowset` package is part of the standard Java Runtime (JDK/JRE) since Java 1.5. If you've downloaded Java you already have this package. – Thomas Kläger Oct 12 '21 at 21:56
  • Which version of Java does the textbook assume you are using? And which version are you actually using? See related: [JAVA ERROR : package com.sun.rowset is not visible : com.sun.rowset is declared in module java.sql.rowset, which does not export it](https://stackoverflow.com/questions/48129475/java-error-package-com-sun-rowset-is-not-visible-com-sun-rowset-is-declared). – andrewJames Oct 12 '21 at 22:16
  • 4
    Use a factory via [`RowSetProvider`](https://docs.oracle.com/en/java/javase/17/docs/api/java.sql.rowset/javax/sql/rowset/RowSetProvider.html) rather than directly addressing the implementation class. See Answers on [the Question](https://stackoverflow.com/questions/48129475/java-error-package-com-sun-rowset-is-not-visible-com-sun-rowset-is-declared) linked [by andrewJames](https://stackoverflow.com/questions/69546876/where-to-download-the-com-sun-package-in-java-in-order-to-use-com-sun-rowset-jdb?noredirect=1#comment122928245_69546876). – Basil Bourque Oct 12 '21 at 22:54
  • I'm using the latest jdk 17 – korpe Oct 12 '21 at 23:35
  • And a very old book. – user207421 Oct 13 '21 at 00:49
  • Introduction to Java Programming and Data Structures, Comprehensive Version, 12th edition... I don't believe this is an old book. – korpe Oct 19 '21 at 18:46
  • That book was first published twenty-three years ago, in 1998, back when Java 1.1 (or maybe 1.2) was released. I'm sure the book has been revised many times over the years - but it seems that this outdated information has not been corrected/updated, yet. – andrewJames Oct 19 '21 at 18:57

0 Answers0