Java and SQL Server supported data types

Applies to: SQL Server 2019 (15.x)

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
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