Home | Previous Page | Next Page   Appendix C. Mapping Data Types > Data Type Mapping for PreparedStatement.setXXX() Extensions >

Extension Summary

The following table lists the PreparedStatement.setXXX() methods that Informix JDBC Driver supports for nonextended data types. The top heading lists the standard JDBC API data types defined in the java.sql.Types class. These translate to specific Informix data types, as shown in the table in Data Type Mapping Between Extended Types and Java and JDBC Types. The table below lists the setXXX() methods you can use to write data of a particular JDBC API data type. An uppercase and bold X indicates the setXXX() method that it is recommended you use with IBM Informix JDBC Driver; a lowercase x indicates other setXXX()methods that IBM Informix JDBC Driver supports.

setXXX() Method JDBC API Data Types from java.sql.Types
TINYINT SMALLINT INTEGER BIGINT REAL FLOAT DOUBLE DECIMAL NUMERIC BIT CHAR VARCHAR LONGVARCHAR BINARY VARBINARY LONGVARBINARY DATE TIME TIMESTAMP
setByte() X x x x x x x x x x1 x1
setShort() x X x x x x x x x x1 x1
setInt() x x X x x x x x x x1 x1
setLong() x x x X x x x x x x1 x1
setFloat() x x x x X x x x x x1 x1
setDouble() x x x x x X X x x x1 x1
setBigDecimal() x x x x x x x X X x x
setBoolean() x x x x x x x x x x x
setString() x x x x x x x x x X X x x x x x x x
setBytes() x X X x
setDate() x x X x
setTime() x x X x
setTimestamp() x x x X
setAsciiStream() X x x x
setCharacterStream() X x x x
setUnicodeStream()
setBinaryStream() x x x X
setObject() x x x x x x x x x x x x2 x x x2 x x3 x
Notes:1 The column value must match the type of setXXX() exactly, or an SQLException is raised. If the column value is not within the allowed value range, the setXXX() method raises an exception instead of converting the data type. For example, setByte(1) raises an SQLException if the value being written is 1000. 2 A byte array is written.3 A Timestamp object is written instead of a Time object.

The setNull() method writes an SQL null value.

The following table lists the PreparedStatement.setXXX() methods that IBM Informix JDBC Driver supports for the Informix extended data types, the mappings for which are shown in the table on page ***. The table lists the setXXX() methods you can use to write data of a particular extended data type.

An uppercase and bold X indicates the recommended setXXX() method to use; a lowercase x indicates other setXXX() methods supported by IBM Informix JDBC Driver. The table does not include setXXX() methods that you cannot use with any of the Informix extended data types.

setXXX() Method Informix Extended Data Types
BOOLEAN LVARCHAR Opaque types BLOB CLOB BYTE TEXT NAMED ROW UNNAMED ROW SET or MULTISET LIST
setByte() x x
setShort() x
setInt() x
setBoolean() X
setString() X x x
setBytes() x x
setAsciiStream() x x X
setCharacterStream() x x X
setBinaryStream() x x X
setObject() x x X x x x x X X x x
setArray() x x
setBlob() X
setClob() X

The setNull() method writes an SQL null value.

Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]