Java and SQL Server supported data types

APPLIES TO: yesSQL Server noAzure SQL Database noAzure Synapse Analytics (SQL DW) noParallel Data Warehouse

This article maps SQL Server data types to Java data types for data structures and parameters on sp_execute_external_script.

The following SQL and Java data types are currently supported for Input/Output data sets and Input/Output parameters.

SQL data type Java data type Comment
Bit boolean
Tinyint short
Smallint short
Int int
Real float
Bigint long
float double
nchar(n) String
nvarchar(n) String
binary(n) byte[]
varbinary(n) byte[]
nvarchar(max) String
varbinary(max) byte[]
uniqueidentifier String
char(n) String Only UTF8 Strings supported
varchar(n) String Only UTF8 Strings supported
varchar(max) String Only UTF8 Strings supported
date java.sql.date
numeric java.math.BigDecimal
decimal java.math.BigDecimal
money java.math.BigDecimal
smallmoney java.math.BigDecimal
smalldatetime java.sql.timestamp
datetime java.sql.timestamp
datetime2 java.sql.timestamp

Next steps