Table 4 specifies the I/O functions that you must implement for the nondefault case, and their related data types.
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:
Names the type of function in conformance with UDT specifications
A conceptual description of the format of the data in the SQL buffer that is being converted
Names the actual data types being read or written
It is an intermediate type that is contained in and manipulated by a Java Stream. It is also the argument type for input methods and the return type for output methods.
Names the actual stream type that is passed to the SQLData interface when the default I/O functions are used. Each of the streams implements IfmxUDTSQLInput or IfmxUDTSQLOutput.
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.
The following sections briefly describe the Java classes that implement the IfmxUDTSQLInput and IfmxUDTSQLOutput interfaces.
These streams convert to and from the internal data representation that the database server uses.
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.
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.
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.
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.
Figure 1 describes the class layout for input. The class layout for output is similar; simply replace In with Out in the names.