jTDS native to JDBC data type mapping

| Home | FAQ | Documentation | Links | License | Project Info | Download | News | Bugs | Forums jTDS native type mapping Below is the mapping between native SQL types and java objects.
Native type | Java Object | JDBC Type | Comment
--- | --- | --- | ---
Numeric types
tinyint | java.lang.Integer | TINYINT |
smallint | java.lang.Integer | SMALLINT |
unsigned smallint | java.lang.Integer | INTEGER | Sybase only
int | java.lang.Integer | INTEGER |
unsigned int | java.lang.Integer | BIGINT | Sybase only
bigint | java.lang.Long | BIGINT | SQL 2000/Sybase 15+
unsigned bigint | java.math.BigDecimal | DECIMAL | Sybase only
numeric | java.math.BigDecimal | NUMERIC |
decimal | java.math.BigDecimal | DECIMAL |
smallmoney | java.math.BigDecimal | DECIMAL |
money | java.math.BigDecimal | DECIMAL |
real | java.lang.Float | REAL |
float | java.lang.Double | DOUBLE |
Logical type
bit | java.lang.Boolean | BIT |
Character types
char | java.lang.String | CHAR |
varchar | java.lang.String | VARCHAR |
nchar | java.lang.String | CHAR |
nvarchar | java.lang.String | VARCHAR |
unichar | java.lang.String | CHAR | Sybase only
univarchar | java.lang.String | VARCHAR | Sybase only
text | java.sql.Clob | CLOB |
ntext | java.sql.Clob | CLOB | Microsoft only
unitext | java.sql.Clob | CLOB | Sybase only
Binary types
binary | byte[] | BINARY |
varbinary | byte[] | VARBINARY |
image | java.sql.Blob | BLOB |
Datetime types
smalldatetime | java.sql.Timestamp | TIMESTAMP |
datetime | java.sql.Timestamp | TIMESTAMP |
date | java.sql.Date | DATE | Sybase only
time | java.sql.Time | TIME | Sybase only
Other types
uniqueidentifier | java.lang.String | VARCHAR | Microsoft only
sql_variant | java.lang.String | VARCHAR | MS only TDS7
sql_variant | Depends on value | OTHER | MS only TDS8
Project hosted by | WebRing member | Web Design Anca Sinpalean