Skip Headers

# Schema Manager Java and Database Type Conversion

Previous

Next

Table: Java and Database Field Type Conversion lists the Java type to database type conversions that the schema manager supports depending on the database platform your TopLink project uses. This list is specific to the schema manager and does not apply to mappings. TopLink automatically performs conversions between any database types within mappings.

Java and Database Field Type Conversion

Java Type | Oracle | DB2 | Sybase | MySQL | MS Access
--- | --- | --- | --- | --- | ---
`java.lang.Boolean` | NUMBER | SMALLINT | BIT default 0 | TINYINT(1) | SHORT
`java.lang.Byte` | NUMBER | SMALLINT | SMALLINT | TINYINT | SHORT
`java.lang.Byte``[]` | LONG RAW | BLOB | IMAGE | BLOB | LONGBINARY
`java.lang.Character` | CHAR | CHAR | CHAR | CHAR | TEXT
`java.lang.Character[]` | LONG | CLOB | TEXT | TEXT | LONGTEXT
`java.lang.Double` | NUMBER | FLOAT | FLOAT(32) | DOUBLE | DOUBLE
`java.lang.Float` | NUMBER | FLOAT | FLOAT(16) | FLOAT | DOUBLE
`java.lang.Integer` | NUMBER | INTEGER | INTEGER | INTEGER | LONG
`java.lang.Long` | NUMBER | INTEGER | NUMERIC | BIGINT | DOUBLE
`java.lang.Short` | NUMBER | SMALLINT | SMALLINT | SMALLINT | SHORT
`java.lang.String` | VARCHAR2 | VARCHAR | VARCHAR | VARCHAR | TEXT
`java.math.BigDecimal` | NUMBER | DECIMAL | NUMERIC | DECIMAL | DOUBLE
`java.math.BigInteger` | NUMBER | DECIMAL | NUMERIC | BIGINT | DOUBLE
`java.sql.Date` | DATE | DATE | DATETIME | DATE | DATETIME
`java.sql.Time` | DATE | TIME | DATETIME | TIME | DATETIME
`java.sql.Timestamp` | DATE | TIMESTAMP | DATETIME | DATETIME | DATETIME

For more information about database platforms that TopLink supports, see "Database Platforms".