NonStop Server for Java (NSJ) Programmer's Guide (NSJ 2.0+)
byte[ ] blob_contents = results.getBytes(2);
Removing Obsolete BLOB Files
A Cleanup utility is provided to periodically remove obsolete BLOB files from the file system. BLOB files become obsolete as
a result of one of the following operations:
An application updates a BLOB column. The driver creates a new BLOB file to store the new BLOB object. It then
writes the name of the new BLOB file in the table. The BLOB file containing the original BLOB now becomes obsolete.
●
The application deletes a row containing a BLOB from the table. The BLOB filename is removed from the table and is
not referenced by any other tables. The blob file is now obsolete.
●
The Cleanup utility uses a BLOB map file. The JDBC driver adds an entry for every BLOB file created by an application to
this BLOB map file. During cleanup, the JDBC driver deletes all obsolete BLOB files from the file system and their
corresponding entries from the BLOB map file.
The Cleanup utility can be run only by the owner of the BLOB map file. It is the responsibility of the owner of the application
to run the Cleanup utility for removing any obsolete BLOB files that have been created for it from the file system. This utility
should be run ONLY when none of the affected tables containing BLOBs are in use. This is necessary to maintain the integrity
of the application's database tables. The Cleanup utility is a java application that should be run from the command line in the
following way:
java com.tandem.sqlmp.SQLMPBlobCleanup [errfile]
where:
com.tandem.sqlmp.SQLMPBlobCleanup
is the Cleanup utility
Blob map file
is the BLOB map file name specified by the application.
errfile
is the name of a file to which any errors encountered during cleanup will be logged.
The Blob map file parameter is required to successfully run the Cleanup utility. The error file can optionally be provided
to log any errors encountered during cleanup.
Note: The Guardian name of the Blob map file (in the $volume.subvolume.filename format) must be
provided to the Cleanup utility. The Blob map file name must be enclosed in single quotes so that it is not
interpreted by the OSS shell. For example:
java com.tandem.sqlmp.SQLMPBlobCleanup '$myvol.blobs.mapfile' err
Miscellaneous Features
Several additional changes have been made in JDBC 2.0 API. Generally, these changes consist of additional or changed
methods to existing classes. Included in this miscellaneous category are the getBigDecimal and getDate methods in the
ResultSet class and the getLogWriter and setLogWriter methods in the DriverManager class.
Standard Extension Enhancements
The Sun Microsystems document that describes the JDBC 2.0 Standard Extension API has not been finalized. The following
describes the current content of that document.
The enhancements to the JDBC 2.0 Standard Extension API include the following:
JNDI for naming databases●
Connection pooling●
Distributed transaction support●