Data type mapping
- Last Updated: August 5, 2020
- 1 minute read
- DataDirect Connectors
- JDBC
- Autonomous REST Connector 6.0
- Documentation
You can manually configure the mapping of data types to a column using the following syntax in a column definition.
"<column_name>":"<data_type>(<size_parameters>)",
- column_name
- is the name of the column in your relational table.
- data_type
- is the case-insensitive name of the data type to which you want to
map the column. For columns for which no data type is defined, the driver heuristically
maps the column to the most appropriate data type. If a value of
nullis specified, the column is mapped to the default data type,varchar(50). See the "Supported Data Types and Parameters" table for a list supported data types. - size_parameters
- (optional) is the length, precision and/or scale of the specified data type. If this value is not specified, the driver will use the default value for the data type.
For example:
"price":"decimal(18.2)",
"name":"Varchar(256)",
"age":"Integer",
The following table documents the supported data types and parameters.
| Data Type and Parameters | Characteristics |
|---|---|
| BigInt | Range: -99*1018 to 99*1018 |
| Binary(l) | Range: -99*1032765 to 99*1032765
|
| Bit | Valid values: 0 or 1
|
| Boolean | Valid values: 0 or 1
|
| Char(l) | Precision: 255
|
| Date1 | Precision: 10 |
| Decimal(p.s) | Range: -99*1014 to 99*1014Minimum scale: Maximum scale: |
| Double | Range: -99*1051 to 99*1051 |
| Float | Range: -99*1022 to 99*1022 |
| GUID | Range: -99*10522 to 99*10522 |
| Integer | Range: -99*108 to 99*108 |
| JSON | Precision: 16777215
|
| LongVarBinary(l) | Precision 16777215
|
| LongVarChar(l) | Precision: 16777215
|
| NVarChar(l) | Precision: 32767
|
| SmallInt | Range: -99999 to 99999 |
| Time(s)2 | Precision: 12 Minimum scale: Maximum scale: |
| Timestamp(s)3 | Precision: 23
Minimum scale: Maximum scale: |
| TinyInt | Range: -999 to 999 |
| VarBinary(l) | Precision: 16777215
|
| VarChar(l) | Precision: 32767
|
1 Formats for Data, Time, and
Timestamp values are configurable. For more information, see Date, time, and timestamp formats
2 Formats for Data, Time, and
Timestamp values are configurable. For more information, see Date, time, and timestamp formats
3 Formats for Data, Time, and
Timestamp values are configurable. For more information, see Date, time, and timestamp formats