Home | Previous Page | Next Page   Appendix C. Mapping Data Types >

Data Type Mapping for UDT Manager and UDR Manager

When you use the UDTManager and UDRManager classes to create opaque types and Java UDRs in the database server, the driver maps Java method arguments and return types to SQL data types according to the tables in this section. Any data type not shown in these tables is not supported.

If the Java method has arguments of any of the following Java types, the arguments and return type are mapped to SQL types in the server as shown in the following table. The table shows the Informix data type to which each Java data type maps.

Java Data Type
SQL Data Type
boolean, java.lang.Boolean
BOOLEAN
char
CHAR(1)
byte
CHAR(1)
short, java.lang.Short
SMALLINT
int, java.lang.Integer
INT
long, java.lang.Long
INT8
float, java.lang.Float
SMALLFLOAT
double, java.lang.Double
FLOAT1
java.lang.String
LVARCHAR
java.math.BigDecimal
DECIMAL

Default precision is set by the server to be:
DECIMAL(16,0) for an ANSI database
decimal (16,255) for a non-ANSI database

java.sql.Date
DATE
java.sql.Time
DATETIME HOUR TO SECOND
java.sql.Timestamp
DATETIME YEAR TO FRACTION(5)
com.informix.lang.IntervalYM
INTERVAL YEAR TO MONTH
com.informix.lang.IntervalDF
INTERVAL DAY TO FRACTION(5)
java.sql.Blob
BLOB
java.sql.Clob
CLOB

1 This mapping is JDBC compliant. You can map the Java double data type (via the JDBC FLOAT data type) to the Informix SMALLFLOAT data type for backward compatibility by setting the IFX_GET_SMFLOAT_AS_FLOAT environment variable to 1.

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