Java Data Type Issues
This section contains information that may be of use to the PSQL Java programmer:
Binary Large Object Support
Support has been added to the Java Class Library to handle Binary Large Objects or BLOBs. BLOBs represent large (up to 4 Gigabytes) binary data, and are represented as LONGVARBINARY data types in the PSQL engine. The Java Class Library supports these data types through these methods (which are found in the PSQL.database.Row class):
public void setObject(int columnNumber, Serializable object),
public void setObject(String columnName, Serializable object),
public Serializable getObject(int columnNumber),
public Serializable getObject(String columnName),
public InputStream getBinaryStream(int columnNumber),
public InputStream getBinaryStream(String columnName),
public void setBinaryStream(int columnNumber, InputStream inStream),
public void setBinaryStream(String columnName, InputStream inStream)
where columnNumber = the zero based sequence number of a column in the row buffer. columnName = the name of a column in the row buffer. object = a serializable Java object to store into the database. inStream = a Java InputStream object used to stream bytes into the database.
The methods above can be split into two categories: those that operate on Serialized Java objects and those that operate on Java InputStream objects. Each of these categories will be discussed further in the following sections. In the following sections, examples will be assuming that a table named Employees has been created with the following schema:
*Note: Employee_Data and Manager_Report have the "not null" specification in their definitions because the Java Class Library does not yet support the True Null feature found in PSQL 2000 and later versions.
table Employees (SS_Num ubigint primary key,
   Employee_Data longvarbinary not null,
   Manager_Report longvarbinary not null)
Data inserted into a “one byte integer column” with the SQL Interface cannot be retrieved with the Java Interface
The PSQL database engines interpret one byte integers as having possible values from 0 to 255. Java interprets its byte type as signed quantities with possible values from -128 to 127.
Because of this difference in interpretation, your code must perform the procedure described here so that data is not misinterpreted.
int theOneByteInt = 0;
PSQL.database.Row row = _rowset.getNext();
theOneByteInt = row.getByte("OneByte") & 0x00FF;
listCourses.add(theOneByteInt + " ");
 
*Note: All Java data types are signed.
For more information on Java data types and other Java language information, please see http://java.sun.com/docs/books/tutorial/index.html.