Appendix D. SQL Types
Prev |  | Next

## Appendix D. SQL Types

Following is a table of the java class to SQL type that is generated by the `schematool`.

| Note
Kodo does not impose these table constraints: they are merely the default column types that are generated for each of the included dictionaries. These types can easily be overridden by extending `com.solarmetric.kodo.impl.jdbc.schema.dict.GenericDictionary`.

Table D.1. SQL Type Mappings

| `STRING` | `CLOB` | `LENSTRING` | `BOOLEAN` | `BYTE`
--- | --- | --- | --- | --- | ---
`MySQL` | `VARCHAR(255)` | `TEXT` | `VARCHAR({0})` | `SMALLINT` | `SMALLINT`
`Hypersonic SQL` | `VARCHAR(255)` | `LONGVARCHAR` | `VARCHAR({0})` | `SMALLINT` | `SMALLINT`
`DB2` | `VARCHAR(255)` | `CLOB(1M)` | `VARCHAR({0})` | `SMALLINT` | `SMALLINT`
`Generic` | `VARCHAR(255)` | `CLOB` | `VARCHAR({0})` | `TINYINT` | `SMALLINT`
`InstantDB` | `VARCHAR(255)` | `TEXT` | `VARCHAR({0})` | `BYTE` | `BYTE`
`Oracle` | `VARCHAR2(255)` | `CLOB` | `VARCHAR2({0})` | `NUMBER(1)` | `SMALLINT`
`Postgres` | `VARCHAR(255)` | `TEXT` | `VARCHAR({0})` | `INT2` | `INT2`
`SQLServer` | `VARCHAR(255)` | `TEXT` | `VARCHAR({0})` | `SMALLINT` | `SMALLINT`

Table D.2. SQL Type Mappings II

| `CHARACTER` | `REAL` | `DOUBLE` | `INTEGER` | `LONG`
--- | --- | --- | --- | --- | ---
`MySQL` | `CHAR(1)` | `REAL` | `DECIMAL(50,80)` | `INTEGER` | `BIGINT`
`Hypersonic SQL` | `CHAR(1)` | `REAL` | `DOUBLE` | `INTEGER` | `BIGINT`
`DB2` | `CHAR(1)` | `REAL` | `DOUBLE` | `INTEGER` | `BIGINT`
`Generic` | `CHAR(1)` | `REAL` | `DOUBLE` | `INTEGER` | `BIGINT`
`InstantDB` | `CHAR(1)` | `REAL` | `DOUBLE` | `INT` | `LONG`
`Oracle` | `CHAR(1)` | `REAL` | `NUMBER` | `NUMBER` | `NUMBER`
`Postgres` | `CHAR(1)` | `REAL` | `DECIMAL` | `INT4` | `INT8`
`SQLServer` | `CHAR(1)` | `REAL` | `FLOAT(32)` | `INTEGER` | `NUMERIC(19)`

Table D.3. SQL Type Mappings III

| `SHORT` | `DATE` | `BLOB` | `BIGINTEGER` | `BIGDECIMAL`
--- | --- | --- | --- | --- | ---
`MySQL` | `SMALLINT` | `DATETIME` | `BLOB` | `DECIMAL(200)` | `DECIMAL(200,800)`
`Hypersonic SQL` | `SMALLINT` | `TIMESTAMP` | `VARBINARY` | `DECIMAL` | `DECIMAL`
`DB2` | `SMALLINT` | `TIMESTAMP` | `BLOB(1M)` | `BIGINT` | `DOUBLE`
`Generic` | `SMALLINT` | `TIMESTAMP` | `BLOB` | `BIGINT` | `DECIMAL`
`InstantDB` | `SHORT` | `TIMESTAMP` | `VARBINARY` | `NUMERIC(38,19)` | `DECIMAL(38,19)`
`Oracle` | `NUMBER` | `DATE` | `BLOB` | `NUMBER` | `NUMBER`
`Postgres` | `INT2` | `TIMESTAMP` | `BYTEA` | `NUMERIC` | `DECIMAL`
`SQLServer` | `SMALLINT` | `DATETIME` | `IMAGE` | `NUMERIC(38,0)` | `NUMERIC(38,20)`

Prev | Up | Next
Appendix C. Optional JDO Features | Home | Appendix E. Release Notes