Converting data types - Amazon Redshift

Converting data types

The Amazon Redshift JDBC driver version 2.0 supports many common data formats, converting between Amazon Redshift, SQL, and Java data types.

The following table lists the supported data type mappings.

Amazon Redshift type SQL type Java type

BIGINT

SQL_BIGINT

Long

BOOLEAN

SQL_BIT

Boolean

CHAR

SQL_CHAR

String

DATE

SQL_TYPE_DATE

java.sql.Date

DECIMAL

SQL_NUMERIC

BigDecimal

DOUBLE PRECISION

SQL_DOUBLE

Double

GEOMETRY

SQL_ LONGVARBINARY

byte[]

INTEGER

SQL_INTEGER

Integer

OID

SQL_BIGINT

Long

SUPER

SQL_LONGVARCHAR

String

REAL

SQL_REAL

Float

SMALLINT

SQL_SMALLINT

Short

TEXT

SQL_VARCHAR

String

TIME

SQL_TYPE_TIME

java.sql.Time

TIMETZ

SQL_TYPE_TIME

java.sql.Time

TIMESTAMP

SQL_TYPE_ TIMESTAMP

java.sql.Timestamp

TIMESTAMPTZ

SQL_TYPE_ TIMESTAMP

java.sql.Timestamp

VARCHAR

SQL_VARCHAR

String