Top Description Fields Constructors Methods
org.jooq.impl

public final Class SQLDataType

extends Object
Class Inheritance
Static Imports
org.jooq.SQLDialect.CUBRID, .SQLDialect.DERBY, .SQLDialect.FIREBIRD, .SQLDialect.H2, .SQLDialect.HSQLDB, .SQLDialect.IGNITE, .SQLDialect.MARIADB, .SQLDialect.MYSQL, .SQLDialect.POSTGRES, .SQLDialect.SQLITE, .SQLDialect.YUGABYTEDB

The SQL standard data types, as described in Types.

These types are usually the ones that are referenced by generated source code. Most RDBMS have an almost 1:1 mapping between their vendor-specific types and the ones in this class (except Oracle). Some RDBMS also have extensions, e.g. for geospacial data types. See the dialect-specific data type classes for more information.

Author
Lukas Eder

Field Summary

Modifier and TypeField and Description
public static final DataType<Long>
public static final DataType<ULong>
BIGINTUNSIGNED

The unsigned Types#BIGINT type.

public static final DataType<byte[]>
public static final DataType<Boolean>
BIT

The Types#BIT type.

public static final DataType<byte[]>
BLOB

The Types#BLOB type.

public static final DataType<Boolean>
public static final DataType<String>
CHAR

The Types#CHAR type.

public static final DataType<String>
CLOB

The Types#CLOB type.

public static final DataType<Date>
DATE

The Types#DATE type.

public static final DataType<BigDecimal>
public static final DataType<BigInteger>
DECIMAL_INTEGER

The zero-scale Types#DECIMAL type.

public static final DataType<Double>
public static final DataType<Double>
FLOAT

The Types#FLOAT type.

public static final DataType<Geography>
public static final DataType<Geometry>
GEOMETRY

The Geometry type.

public static final DataType<Instant>
INSTANT

A Types#TIMESTAMP_WITH_TIMEZONE type that uses UTC as time zone.

public static final DataType<Integer>
public static final DataType<UInteger>
INTEGERUNSIGNED

The unsigned Types#INTEGER type.

public static final DataType<YearToSecond>
INTERVAL

A vendor specific INTERVAL YEAR TO SECOND data type, which combines INTERVALYEARTOMONTH and INTERVALDAYTOSECOND.

public static final DataType<DayToSecond>
INTERVALDAYTOSECOND

The SQL standard INTERVAL DAY TO SECOND data type.

public static final DataType<YearToMonth>
INTERVALYEARTOMONTH

The SQL standard INTERVAL YEAR TO MONTH data type.

public static final DataType<JSON>
JSON

The JSON type.

public static final DataType<JSONB>
JSONB

The JSONB type.

public static final DataType<LocalDate>
public static final DataType<LocalDateTime>
public static final DataType<LocalTime>
public static final DataType<String>
public static final DataType<byte[]>
public static final DataType<String>
public static final DataType<String>
NCHAR

The Types#NCHAR type.

public static final DataType<String>
NCLOB

The Types#NCLOB type.

public static final DataType<BigDecimal>
public static final DataType<String>
public static final DataType<OffsetDateTime>
public static final DataType<OffsetTime>
public static final DataType<Object>
OTHER

The Types#OTHER type.

public static final DataType<Float>
REAL

The Types#REAL type.

public static final DataType<Record>
public static final DataType<Result<Record>>
RESULT

The ResultSet type.

public static final DataType<RowId>
ROWID

The Types#ROWID type.

public static final DataType<Short>
public static final DataType<UShort>
SMALLINTUNSIGNED

The unsigned Types#SMALLINT type.

public static final DataType<Time>
TIME

The Types#TIME type.

public static final DataType<Timestamp>
public static final DataType<OffsetDateTime>
public static final DataType<OffsetTime>
public static final DataType<Byte>
public static final DataType<UByte>
TINYINTUNSIGNED

The unsigned Types#TINYINT type.

public static final DataType<UUID>
UUID

The UUID type.

public static final DataType<byte[]>
public static final DataType<String>
public static final DataType<XML>
XML

The XML type.

public static final DataType<Year>
YEAR

A Types#SMALLINT type that represents a year.

Constructor Summary

AccessConstructor and Description
private
SQLDataType()

No instances

Method Summary

Modifier and TypeMethod and Description
public static final DataType<byte[]>
BINARY(int length)

The Types#BINARY type.

public static final DataType<byte[]>
BLOB(int length)

The Types#BLOB type.

public static final DataType<String>
CHAR(int length)

The Types#CHAR type.

public static final DataType<String>
CLOB(int length)

The Types#CLOB type.

public static final DataType<BigDecimal>
DECIMAL(int precision)

The Types#DECIMAL type.

public static final DataType<BigDecimal>
DECIMAL(int precision, int scale)

The Types#DECIMAL type.

public static final DataType<BigInteger>
DECIMAL_INTEGER(int precision)

The zero-scale Types#DECIMAL type.

private static final void
public static final DataType<Instant>
INSTANT(int precision)

A Types#TIMESTAMP_WITH_TIMEZONE type that uses UTC as time zone.

public static final DataType<LocalDateTime>
LOCALDATETIME(int precision)

The Types#TIMESTAMP type.

public static final DataType<LocalTime>
LOCALTIME(int precision)

The Types#TIME type.

public static final DataType<String>
LONGNVARCHAR(int length)

The Types#LONGNVARCHAR type.

public static final DataType<byte[]>
LONGVARBINARY(int length)

The Types#LONGVARBINARY type.

public static final DataType<String>
LONGVARCHAR(int length)

The Types#LONGVARCHAR type.

public static final DataType<String>
NCHAR(int length)

The Types#NCHAR type.

public static final DataType<String>
NCLOB(int length)

The Types#NCLOB type.

public static final DataType<BigDecimal>
NUMERIC(int precision)

The Types#NUMERIC type.

public static final DataType<BigDecimal>
NUMERIC(int precision, int scale)

The Types#NUMERIC type.

public static final DataType<String>
NVARCHAR(int length)

The Types#NVARCHAR type.

public static final DataType<OffsetDateTime>
public static final DataType<OffsetTime>
OFFSETTIME(int precision)

The Types#TIME_WITH_TIMEZONE type.

public static final DataType<Time>
TIME(int precision)

The Types#TIME type.

public static final DataType<Timestamp>
TIMESTAMP(int precision)

The Types#TIMESTAMP type.

public static final DataType<OffsetDateTime>
public static final DataType<OffsetTime>
public static final DataType<byte[]>
VARBINARY(int length)

The Types#VARBINARY type.

public static final DataType<String>
VARCHAR(int length)

The Types#VARCHAR type.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

BIGINTback to summary
public static final DataType<Long> BIGINT

The Types#BIGINT type.

BIGINTUNSIGNEDback to summary
public static final DataType<ULong> BIGINTUNSIGNED

The unsigned Types#BIGINT type.

BINARYback to summary
public static final DataType<byte[]> BINARY

The Types#BINARY type.

BITback to summary
public static final DataType<Boolean> BIT

The Types#BIT type.

BLOBback to summary
public static final DataType<byte[]> BLOB

The Types#BLOB type.

BOOLEANback to summary
public static final DataType<Boolean> BOOLEAN

The Types#BOOLEAN type.

CHARback to summary
public static final DataType<String> CHAR

The Types#CHAR type.

CLOBback to summary
public static final DataType<String> CLOB

The Types#CLOB type.

DATEback to summary
public static final DataType<Date> DATE

The Types#DATE type.

DECIMALback to summary
public static final DataType<BigDecimal> DECIMAL

The Types#DECIMAL type.

DECIMAL_INTEGERback to summary
public static final DataType<BigInteger> DECIMAL_INTEGER

The zero-scale Types#DECIMAL type.

DOUBLEback to summary
public static final DataType<Double> DOUBLE

The Types#DOUBLE type.

FLOATback to summary
public static final DataType<Double> FLOAT

The Types#FLOAT type.

GEOGRAPHYback to summary
public static final DataType<Geography> GEOGRAPHY

The Geography type.

This is not a JDBC standard. This type handles spatial types where they are supported.

If you want to opt out of code generation support for this type, you can specify /configuration/generator/generate/spatialTypes to false.

This data type is supported only by the commercial editions of jOOQ.

GEOMETRYback to summary
public static final DataType<Geometry> GEOMETRY

The Geometry type.

This is not a JDBC standard. This type handles spatial types where they are supported.

If you want to opt out of code generation support for this type, you can specify /configuration/generator/generate/spatialTypes to false.

This data type is supported only by the commercial editions of jOOQ.

INSTANTback to summary
public static final DataType<Instant> INSTANT

A Types#TIMESTAMP_WITH_TIMEZONE type that uses UTC as time zone.

Neither JDBC, nor most SQL databases support the INSTANT data type, which is often the only kind of timestamp which can be expected to behave across all server and client time zone settings. This implementation is backed by the database vendor's TIMESTAMP WITH TIME ZONE data type implementation, which may (e.g. Oracle) or may not (e.g. PostgreSQL) store the timestamp information. Irrespective of that storage, this type will always produce time zone agnostic instants in client code.

INTEGERback to summary
public static final DataType<Integer> INTEGER

The Types#INTEGER type.

INTEGERUNSIGNEDback to summary
public static final DataType<UInteger> INTEGERUNSIGNED

The unsigned Types#INTEGER type.

INTERVALback to summary
public static final DataType<YearToSecond> INTERVAL

A vendor specific INTERVAL YEAR TO SECOND data type, which combines INTERVALYEARTOMONTH and INTERVALDAYTOSECOND.

If you want to opt out of code generation support for this type, you can specify /configuration/generator/generate/intervalTypes to false.

INTERVALDAYTOSECONDback to summary
public static final DataType<DayToSecond> INTERVALDAYTOSECOND

The SQL standard INTERVAL DAY TO SECOND data type.

If you want to opt out of code generation support for this type, you can specify /configuration/generator/generate/intervalTypes to false.

INTERVALYEARTOMONTHback to summary
public static final DataType<YearToMonth> INTERVALYEARTOMONTH

The SQL standard INTERVAL YEAR TO MONTH data type.

If you want to opt out of code generation support for this type, you can specify /configuration/generator/generate/intervalTypes to false.

JSONback to summary
public static final DataType<JSON> JSON

The JSON type.

This is not a JDBC standard. This type handles JSON types where they are supported.

If you want to opt out of code generation support for this type, you can specify /configuration/generator/generate/jsonTypes to false.

JSONBback to summary
public static final DataType<JSONB> JSONB

The JSONB type.

This is not a JDBC standard. This type handles JSONB types where they are supported.

If you want to opt out of code generation support for this type, you can specify /configuration/generator/generate/jsonTypes to false.

LOCALDATEback to summary
public static final DataType<LocalDate> LOCALDATE

The Types#DATE type.

LOCALDATETIMEback to summary
public static final DataType<LocalDateTime> LOCALDATETIME

The Types#TIMESTAMP type.

LOCALTIMEback to summary
public static final DataType<LocalTime> LOCALTIME

The Types#TIME type.

LONGNVARCHARback to summary
public static final DataType<String> LONGNVARCHAR

The Types#LONGNVARCHAR type.

LONGVARBINARYback to summary
public static final DataType<byte[]> LONGVARBINARY

The Types#LONGVARBINARY type.

LONGVARCHARback to summary
public static final DataType<String> LONGVARCHAR

The Types#LONGVARCHAR type.

NCHARback to summary
public static final DataType<String> NCHAR

The Types#NCHAR type.

NCLOBback to summary
public static final DataType<String> NCLOB

The Types#NCLOB type.

NUMERICback to summary
public static final DataType<BigDecimal> NUMERIC

The Types#NUMERIC type.

NVARCHARback to summary
public static final DataType<String> NVARCHAR

The Types#NVARCHAR type.

OFFSETDATETIMEback to summary
public static final DataType<OffsetDateTime> OFFSETDATETIME

The Types#TIMESTAMP_WITH_TIMEZONE type.

The behaviour of this data type is influenced by the JDBC driver and the database that is used. Some databases support actual time zones (as in ZonedDateTime), other databases support only offsets (as in OffsetDateTime). Some databases retain the actual time zone information that is stored and reproduce it with every fetch (e.g. SQLDialect#ORACLE), others use this type as a synonym for a timestamp in UTC (e.g. SQLDialect#POSTGRES), producing possibly a value in the current time zone of the database or the client. Please refer to your database for more information about the behaviour of this data type.

OFFSETTIMEback to summary
public static final DataType<OffsetTime> OFFSETTIME

The Types#TIME_WITH_TIMEZONE type.

The behaviour of this data type is influenced by the JDBC driver and the database that is used. Some databases support actual time zones (as in ZonedDateTime), other databases support only offsets (as in OffsetDateTime). Some databases retain the actual time zone information that is stored and reproduce it with every fetch (e.g. SQLDialect#ORACLE), others use this type as a synonym for a timestamp in UTC (e.g. SQLDialect#POSTGRES), producing possibly a value in the current time zone of the database or the client. Please refer to your database for more information about the behaviour of this data type.

OTHERback to summary
public static final DataType<Object> OTHER

The Types#OTHER type.

REALback to summary
public static final DataType<Float> REAL

The Types#REAL type.

RECORDback to summary
public static final DataType<Record> RECORD

The Types#STRUCT type.

RESULTback to summary
public static final DataType<Result<Record>> RESULT

The ResultSet type.

This is not a JDBC standard. This type emulates REF CURSOR types and similar constructs

Annotations
@SuppressWarnings:unchecked, rawtypes
ROWIDback to summary
public static final DataType<RowId> ROWID

The Types#ROWID type.

SMALLINTback to summary
public static final DataType<Short> SMALLINT

The Types#SMALLINT type.

SMALLINTUNSIGNEDback to summary
public static final DataType<UShort> SMALLINTUNSIGNED

The unsigned Types#SMALLINT type.

TIMEback to summary
public static final DataType<Time> TIME

The Types#TIME type.

TIMESTAMPback to summary
public static final DataType<Timestamp> TIMESTAMP

The Types#TIMESTAMP type.

TIMESTAMPWITHTIMEZONEback to summary
public static final DataType<OffsetDateTime> TIMESTAMPWITHTIMEZONE

The Types#TIMESTAMP_WITH_TIMEZONE type.

An alias for OFFSETDATETIME

TIMEWITHTIMEZONEback to summary
public static final DataType<OffsetTime> TIMEWITHTIMEZONE

The Types#TIME_WITH_TIMEZONE type.

An alias for OFFSETTIME

TINYINTback to summary
public static final DataType<Byte> TINYINT

The Types#TINYINT type.

TINYINTUNSIGNEDback to summary
public static final DataType<UByte> TINYINTUNSIGNED

The unsigned Types#TINYINT type.

UUIDback to summary
public static final DataType<UUID> UUID

The UUID type.

This is not a JDBC standard. This type handles UUID types where they are supported

VARBINARYback to summary
public static final DataType<byte[]> VARBINARY

The Types#VARBINARY type.

VARCHARback to summary
public static final DataType<String> VARCHAR

The Types#VARCHAR type.

XMLback to summary
public static final DataType<XML> XML

The XML type.

This is not a JDBC standard. This type handles XML types where they are supported.

If you want to opt out of code generation support for this type, you can specify /configuration/generator/generate/xmlTypes to false.

YEARback to summary
public static final DataType<Year> YEAR

A Types#SMALLINT type that represents a year.

While JDBC does not support this type, some dialects do, specifically those of the SQLDialectCategory#MYSQL category.

Constructor Detail

SQLDataTypeback to summary
private SQLDataType()

No instances

Method Detail

BINARYback to summary
public static final DataType<byte[]> BINARY(int length)

The Types#BINARY type.

BLOBback to summary
public static final DataType<byte[]> BLOB(int length)

The Types#BLOB type.

CHARback to summary
public static final DataType<String> CHAR(int length)

The Types#CHAR type.

CLOBback to summary
public static final DataType<String> CLOB(int length)

The Types#CLOB type.

DECIMALback to summary
public static final DataType<BigDecimal> DECIMAL(int precision)

The Types#DECIMAL type.

DECIMALback to summary
public static final DataType<BigDecimal> DECIMAL(int precision, int scale)

The Types#DECIMAL type.

DECIMAL_INTEGERback to summary
public static final DataType<BigInteger> DECIMAL_INTEGER(int precision)

The zero-scale Types#DECIMAL type.

initJSR310Typesback to summary
private static final void initJSR310Types(SQLDialect family)
INSTANTback to summary
public static final DataType<Instant> INSTANT(int precision)

A Types#TIMESTAMP_WITH_TIMEZONE type that uses UTC as time zone.

Neither JDBC, nor most SQL databases support the INSTANT data type, which is often the only kind of timestamp which can be expected to behave across all server and client time zone settings. This implementation is backed by the database vendor's TIMESTAMP WITH TIME ZONE data type implementation, which may (e.g. Oracle) or may not (e.g. PostgreSQL) store the timestamp information. Irrespective of that storage, this type will always produce time zone agnostic instants in client code.

LOCALDATETIMEback to summary
public static final DataType<LocalDateTime> LOCALDATETIME(int precision)

The Types#TIMESTAMP type.

LOCALTIMEback to summary
public static final DataType<LocalTime> LOCALTIME(int precision)

The Types#TIME type.

LONGNVARCHARback to summary
public static final DataType<String> LONGNVARCHAR(int length)

The Types#LONGNVARCHAR type.

LONGVARBINARYback to summary
public static final DataType<byte[]> LONGVARBINARY(int length)

The Types#LONGVARBINARY type.

LONGVARCHARback to summary
public static final DataType<String> LONGVARCHAR(int length)

The Types#LONGVARCHAR type.

NCHARback to summary
public static final DataType<String> NCHAR(int length)

The Types#NCHAR type.

NCLOBback to summary
public static final DataType<String> NCLOB(int length)

The Types#NCLOB type.

NUMERICback to summary
public static final DataType<BigDecimal> NUMERIC(int precision)

The Types#NUMERIC type.

NUMERICback to summary
public static final DataType<BigDecimal> NUMERIC(int precision, int scale)

The Types#NUMERIC type.

NVARCHARback to summary
public static final DataType<String> NVARCHAR(int length)

The Types#NVARCHAR type.

OFFSETDATETIMEback to summary
public static final DataType<OffsetDateTime> OFFSETDATETIME(int precision)

The Types#TIMESTAMP_WITH_TIMEZONE type.

The behaviour of this data type is influenced by the JDBC driver and the database that is used. Some databases support actual time zones (as in ZonedDateTime), other databases support only offsets (as in OffsetDateTime). Some databases retain the actual time zone information that is stored and reproduce it with every fetch (e.g. SQLDialect#ORACLE), others use this type as a synonym for a timestamp in UTC (e.g. SQLDialect#POSTGRES), producing possibly a value in the current time zone of the database or the client. Please refer to your database for more information about the behaviour of this data type.

OFFSETTIMEback to summary
public static final DataType<OffsetTime> OFFSETTIME(int precision)

The Types#TIME_WITH_TIMEZONE type.

The behaviour of this data type is influenced by the JDBC driver and the database that is used. Some databases support actual time zones (as in ZonedDateTime), other databases support only offsets (as in OffsetDateTime). Some databases retain the actual time zone information that is stored and reproduce it with every fetch (e.g. SQLDialect#ORACLE), others use this type as a synonym for a timestamp in UTC (e.g. SQLDialect#POSTGRES), producing possibly a value in the current time zone of the database or the client. Please refer to your database for more information about the behaviour of this data type.

TIMEback to summary
public static final DataType<Time> TIME(int precision)

The Types#TIME type.

TIMESTAMPback to summary
public static final DataType<Timestamp> TIMESTAMP(int precision)

The Types#TIMESTAMP type.

TIMESTAMPWITHTIMEZONEback to summary
public static final DataType<OffsetDateTime> TIMESTAMPWITHTIMEZONE(int precision)

The Types#TIMESTAMP_WITH_TIMEZONE type.

An alias for OFFSETDATETIME

TIMEWITHTIMEZONEback to summary
public static final DataType<OffsetTime> TIMEWITHTIMEZONE(int precision)

The Types#TIME_WITH_TIMEZONE type.

An alias for OFFSETTIME

VARBINARYback to summary
public static final DataType<byte[]> VARBINARY(int length)

The Types#VARBINARY type.

VARCHARback to summary
public static final DataType<String> VARCHAR(int length)

The Types#VARCHAR type.