Back


The Linguist data package

The data package (currently under development) provides a framework for access to SQL databases. You will need to provide JDBC drivers for the database you intend to use. The only database that has so far been tested with this package is InstantDB, an all-Java SQL database.

This package uses a 'middle tier' persistence framework to manage a local cache of records, avoiding the need to go to the SQL database for every operation. It also provides a cleaner mechanism for taking care of errors as well as dealing with the interface to different database types. Here is some documentation about the Java classes used.

These are the keywords supplied for database operations:

clear Clear the fields of a record.
commit Commit changes to the database.
create Create a new record.
database Connect to a database.
decrypt Decrypt a record from a string.
delete Delete a record.
encrypt Encrypt a record to a string.
get Get one or more records.
insert Insert a record into the database.
new Start a new transaction.
read Read in an XML file.
record Declare a record variable.
set Set field values or attributes.
specification Declare the specification for a table type.
sql Issue an SQL command to the database.
update Update a record in the database.

Numeric values
String values
Conditional expressions


Numeric Values

These values can be used in either a numeric or string expression:

field {fieldname} of {record}
Returns the contents of the field specifed of record {record}.

Return to top


String Values

These values can be used in a string expression:

the status
Returns a string comprising a result code from the last operation. If no error occurred this string is "OK". Other result codes are:

*** to be implemented ***

encrypted {record}
Returns a string comprising all the fields of the record encrypted using the key held in the record. See encrypt and set.

{record}
Returns a string comprising all the fields of the table holding records of this type, encoded as an XML string.

Return to top


Conditional Expressions

These are the conditional functions available for use with the data package:

[no] more {record}
Returns true if there are (or are not) more records yet to be read in the result set returned by the last query on record {record}.

{record} exists/does not exist
Returns true if a record does (or does not) exist having the ID of the one named.

Return to top


Back