PSQL Java Interface Class Structure
This section describes the classes for the new PSQL Java interface.
Applying the “factory” pattern, almost all classes (with the exception of Driver, Timestamp, FieldDef and PsqlException) can only be produced through methods of another class (or other classes). In the description of classes, under the label Constructors no constructors are listed when no public constructors are available.
The PSQL Java interface has a special class, PsqlException to handle error conditions occurring when methods of the API are invoked. PsqlException extends the java.lang.Exception. Each method of the PSQL Java classes throws PsqlException and for brevity, the following clause is left out from the method definitions:
throws PsqlException
Figure 2 shows all classes and their relationship.
Figure 2 Java API Class Structure
The classes of the PSQL Java Interface can be divided into three groups:
General Classes
The following classes belong to General Classes group:
These classes can be used both for tightly coupled and loosely coupled databases.
Rowset Family Classes
The following classes belong to the Rowset Family Classes group:
These classes make use of the metadata found in the dictionary of a PSQL database and, therefore, can be applied only for tightly coupled databases.
Cursor Family Classes
This is the low-level portion of the PSQL Java Interface. If you use this portion of the interface, you must handle position blocks, data buffers, and other elements of programming that are typical of the Btrieve API.
*Note: You must use this family of the Java interface if your Btrieve files do not have DDFs. You can use the PSQL Control Center utility to create DDF files for your data. See the PSQL User's Guide for more information.
The following classes belong to Cursor Family Classes group:
These classes do not use any meta data, they directly support the “classic” Btrieve operations (for example, through a BTRV method). Therefore, they are applied typically for loosely coupled databases. However, they can also be used to access data files that store tables of a tightly coupled database. (Although, it is more convenient to use the “rowset family” in the latter case.)