Overview of Major Classes and Methods
The following are the principal classes and methods involved in a basic Java application.
 
There are other classes and methods that you can view in the PSQL Java Class Library Reference, but these are the classes you will use most often in your application.
The structure of the Java interface classes is flat; there is no inheritance in these classes.
DRIVER
Driver establishes Sessions. You can use Driver to instantiate as many Session objects as needed. You can also use the KillallSessions method to stop the application, as it will clean up socket connections, database connections, open files, and system resources.
SESSION
Sessions use the connection to the driver and allow you to connect to databases using URIs and start and end transactions. Each session receives a unique Btrieve client ID. Unless your application specifically needs multiple Btrieve client IDs, you can generally use one Session for the entire application. You can reset the Session and the Btrieve client by calling Session.close(). See Btrieve Clients in PSQL Programmer's Guide for more information about client IDs and License Models in PSQL User's Guide.
DATABASE
Objects instantiated using this class are the database itself. Methods in this class allow the developer to, in the case of tightly coupled databases, get the table names, tables and so forth. In the case of the loosely coupled database, the developer can access familiar Btrieve-like APIs including extended operations.
TABLE
An instance of this class represents a table as an object. Using table objects, you can create row sets and get meta data information about tables.
ROWSET
RowSet is an extremely important class. It is used to access the rows of the associated table. In addition, rows can be inserted, updated, and deleted through methods of this class.
An instance of this class represents a set of rows that is derived from the base table. One other way to look at it: a RowSet is a virtual table (a "view") generated from a physically stored table.
*Note: This object can be constructed only through the createRowSet method of Table.
A row set could include all rows or a subset of rows of the base table. A number of methods in RowSetMetaData (e.g.addFirstTerm, addAndTerm, and so forth) is available to provide the terms of a restriction criterion that determines which rows from the base table are included into the row set.
A row set could include all columns or any number of selected columns of the base row. When a RowSet object is created by Table.createRowSet, it is initialized according to the value of noColumns specified explicitly or implicitly in the call. If noColumns is specified as True, then no column is included into the row set and the application can selectively include the columns into the row set by calling RowSetMetaData.addColumns. If noColumns is specified a false or it is not included as an argument then the created RowSet includes all columns of the table.
The applications normally do not have to open and close the row sets. The associated data files are opened at the construction time of the RowSet objects and the data files are closed when either the application explicitly calls RowSet.close or as a result of closing a higher-level associated object (Table, Database, etc).
The elements of a row set can be accessed through Row objects. There multiple options are available to retrieve the rows.
For important additional information about row sets, see PSQL Java Class Library Reference.
ROW
An instance of this class represents a row buffer for a row in a RowSet. The Class Row enables access to rows and to column values within a row. It can be used to retrieve rows, update, or delete rows and to build rows for insertion.
This class has no methods of its own, but the methods inherited from Buffer can be used to get/set values of columns in the row buffer.