Java Packages

We don't have the Java code of the Oracle JDBC drivers, but we can deduce that the code of the ARRAY class (mentioned previously) was in a file named ARRAY.java. And in that file was a package statement:

package oracle.sql;

Notice how the package name correlates with the directory tree, using a dot (.) separator character for the package, instead of a slash for the directory. At Oracle, the corporate developers keep the file ARRAY.java in a directory named sql, which is in a directory named oracle. They compile the class in a matching directory tree. And they create the JAR file by collecting all the compiled content, starting with the oracle directory.

You need to keep this fundamental concept in mind: packages equal directory ...

Get Expert Oracle and Java Security: Programming Secure Oracle Database Applications with Java now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.