Data Types
- Last Updated: May 18, 2020
- 2 minute read
- DataDirect Connectors
- JDBC
- IBM Db2 5.1
- MySQL 5.1
- Progress OpenEdge 5.1
- SAP Sybase 5.1
- Documentation
The following table lists the data types supported by the SQL Server driver and how they are mapped to the JDBC data types.
| Microsoft SQL Server Data Type | JDBC Data Type |
|---|---|
| bigint 1 | BIGINT |
| bigint identity 2 | BIGINT |
| binary | BINARY |
| bit | BIT |
| char | CHAR |
| date | DATE |
| datetime | TIMESTAMP |
| datetime2 | TIMESTAMP |
| datetimeoffset | VARCHAR or TIMESTAMP 3 |
| decimal | DECIMAL |
| decimal() identity | DECIMAL |
| float | FLOAT |
| image | LONGVARBINARY |
| int | INTEGER |
| int identity | INTEGER |
| money | DECIMAL |
| nchar | CHAR or NCHAR 4 |
| ntext | LONGVARCHAR or LONGNVARCHAR 5 |
| numeric | NUMERIC |
| numeric() identity | NUMERIC |
| nvarchar | VARCHAR or NVARCHAR 6 |
| nvarchar(max) 7 | LONGVARCHAR or LONGNVARCHAR8 |
| real | REAL |
| smalldatetime | TIMESTAMP |
| smallint | SMALLINT |
| smallint identity | SMALLINT |
| smallmoney | DECIMAL |
| sql_variant 9 | VARCHAR |
| sysname | VARCHAR |
| text | LONGVARCHAR |
| time 10 | TIME or TIMESTAMP |
| timestamp | BINARY |
| tinyint | TINYINT |
| tinyint identity | TINYINT |
| uniqueidentifier | CHAR |
| varbinary | VARBINARY |
| varbinary(max) 11 | LONGVARBINARY |
| varchar | VARCHAR |
| varchar(max) 12 | LONGVARCHAR |
| xml 13, 14 | LONGVARCHAR or SQLXML 15 |
1 Supported only for Microsoft SQL Server 2000 and
higher.
2 Supported only for Microsoft SQL Server 2000 and
higher.
3 When FetchTSWTZasTimestamp=
false (default), this data type is mapped to the JDBC VARCHAR data type;
when FetchTSWTZasTimestamp=true, it is mapped to
the JDBC TIMESTAMP data type. 4 When JDBCBehavior=
0, the data type depends on the JVM used by that application. For JVMs
earlier than Java SE 6, the first value applies. For Java SE 6 and higher, the
second value applies.5 When JDBCBehavior=
0, the data type depends on the JVM used by that application. For JVMs
earlier than Java SE 6, the first value applies. For Java SE 6 and higher, the
second value applies.6 When JDBCBehavior=
0, the data type depends on the JVM used by that application. For JVMs
earlier than Java SE 6, the first value applies. For Java SE 6 and higher, the
second value applies.7 Supported only for Microsoft SQL Server 2005 and
higher.
8 When JDBCBehavior=
0, the data type depends on the JVM used by that application. For JVMs
earlier than Java SE 6, the first value applies. For Java SE 6 and higher, the
second value applies.9 Supported only for Microsoft SQL Server 2000 and
higher.
10 When FetchTWFSasTime=true, this data type is mapped to the JDBC TIME data type.
When FetchTWFSasTime=false (the default), this data type is mapped to the JDBC TIMESTAMP data type.
11 Supported only for Microsoft SQL Server 2005 and
higher.
12 Supported only for Microsoft SQL Server 2005 and
higher.
13 Supported only for Microsoft SQL Server 2005 and
higher.
14 The XMLDescribeType property overrides the
mappings for XML data.
15 When JDBCBehavior=
0, the data type depends on the JVM used by that application. For JVMs
earlier than Java SE 6, the first value applies. For Java SE 6 and higher, the
second value applies.