Home | Previous Page | Next Page   Using Opaque User-Detfined Types > Overriding the Default I/O Methods >

I/O Function Sets and Related Types

Table 4 specifies the I/O functions that you must implement for the nondefault case, and their related data types.

Table 4. Nondefault I/O Functions and Types Table
Function
Set
Data
Format
Buffer Type Java Stream Implementation
SQL Java
Server UDR UDT Internal Representation IfxDataPointer IfmxSQLInStream IfmxSQLOutStream
Input Output Text LVARCHAR String
(String Buffer)
IfmxTextInStream IfmxTextOutStream
Send Receive Client Binary SENDRECV IfxDataPointer IfmxSRInStream IfmxSROutStream
Import Export Text IMPEXP IfxDataPointer IfmxIEInsStream IfmxIEOutStream
Binary Import Export Client Binary IMPEXBIN IfxDataPointer IfmxIEBinStream IfmxIEBOutStream

The columns in the preceding table represent the following:

IfxDataPointer

The IfxDataPointer class encapsulates the Informix C-language representation of a type and its corresponding data buffer. This is usually a database server buffer structure, with a few attributes extracted for easy access in Java code. This class is used to transport the nontextual SQL data types to and from the I/O methods and is generally managed by an IfmxUDTSQLInput or IfmxUDTSQLOutput stream.

Methods in both streams might throw an SQLException with the e.getErrorcode equal to -79700 or IfxErrMsg.S_MTHNSUPP, if they are not implemented. These methods are generally not needed on the database server side but are useful in the client JDBC code.

For more documentation of these streams, refer to the IBM Informix: JDBC Driver Programmer's Guide. For an example of using these streams, see Usage Example.

Stream Implementations

The following sections briefly describe the Java classes that implement the IfmxUDTSQLInput and IfmxUDTSQLOutput interfaces.

IfmxSQLInStream and IfmxSQLOutStream

These streams convert to and from the internal data representation that the database server uses.

IfmxTextInStream and IfmxTextOutStream

These streams convert to and from a textual data representation for Input and Output functions. IBM Informix Dynamic Server with J/Foundation does not support cross-locale Input and Output routines; all strings are assumed to be in U.S. English.

These streams delimit each component of the composite type with a white space between record elements. The SQL type is an LVARCHAR that contains client text. The JavaBuffer type for Input is String, which contains the client text. The JavaBuffer type for Output is a StringBuffer. The read() and write() methods must convert between the client text representation and the relevant Java object.

IfmxSRInStream and IfmxSROutStream

These streams convert to and from the binary data representation of the client for send and receive functions. The SQL type is SENDRECV, which is an internal representation that contains binary data in the client format. The JavaBuffer type is IfxDataPointer. The read() and write() methods convert between the client representation and the relevant Java object.

IfmxIEInStream and IfmxIEOutStream

This stream converts to and from a canonical text representation for import and export functions. The SQLBuffer is an IMPEXP type that is an internal representation that contains canonical textual data. The JavaBuffer type is IfxDataPointer. The read() and write() methods convert between the text representation and the relevant Java objects. These streams inherit from the IfmxTextInStream and IfmxTextOutStream classes.

IfmxIEBInStream

This stream converts to and from a canonical binary representation for binary import and export functions. The SQLBuffer is an IMPEXPBIN type that is an internal representation that contains canonical binary data. The JavaBuffer type is IfxDataPointer. The read() and write() methods must convert between the binary representation and the relevant Java objects. These streams inherit from the IfmxSRInStream and IfmxSRIOutStream classes.

Class Layout (for Input)

Figure 1 describes the class layout for input. The class layout for output is similar; simply replace In with Out in the names.

Figure 1. .Input Class Layout
Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]