Updated on 2024-05-07 GMT+08:00

Mapping for JDBC Data Types

The index relationships among data types, Java variable types, and JDBC types are as follows:

Compatibility Mode

Gauss Kernel Data Type

Java Variable Type

JDBC Type Index

A/B

oid

java.lang.Long

java.sql.Types.BIGINT

A/B

numeric

java.math.BigDecimal

java.sql.Types.NUMERIC

A/B

tinyint

java.lang.Integer

java.sql.Types.TINYINT

A/B

smallint

java.lang.Integer

java.sql.Types.SMALLINT

A/B

bigint

java.lang.Long

java.sql.Types.BIGINT

A/B

float4

java.lang.Float

java.sql.Types.REAL

A/B

float8

java.lang.Double

java.sql.Types.DOUBLE

A/B

char

java.lang.String

java.sql.Types.CHAR

A/B

character

java.lang.String

java.sql.Types.CHAR

A/B

bpchar

java.lang.String

java.sql.Types.CHAR

A/B

character varying

java.lang.String

java.sql.Types.VARCHAR

A/B

varchar

java.lang.String

java.sql.Types.VARCHAR

A/B

text

java.lang.String

java.sql.Types.VARCHAR

A/B

name

java.lang.String

java.sql.Types.VARCHAR

A/B

bytea

byte[]

java.sql.Types.BINARY

A/B

blob

java.sql.Blob

java.sql.Types.BLOB

A/B

clob

java.sql.Clob

java.sql.Types.CLOB

A/B

boolean

java.lang.Boolean

java.sql.Types.BIT

B

date

java.sql.Date

java.sql.Types.DATE

A/B

time

java.sql.Time

java.sql.Types.TIME

A/B

timetz

java.sql.Time

java.sql.Types.TIME

A/B

timestamp

java.sql.Timestamp

java.sql.Types.TIMESTAMP

A/B

smalldatetime

java.sql.Timestamp

java.sql.Types.TIMESTAMP

A/B

timestamptz

java.sql.Timestamp

java.sql.Types.TIMESTAMP

A/B

refcursor

java.sql.ResultSet

java.sql.Types.REF_CURSOR

java.sql.Types.OTHER

-10