Class SQLDataType
- java.lang.Object
- 
- org.jooq.impl.SQLDataType
 
- 
 public final class SQLDataType extends java.lang.ObjectThe SQL standard data types, as described inTypes.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 SummaryFields Modifier and Type Field Description static DataType<java.lang.Long>BIGINTTheTypes.BIGINTtype.static DataType<ULong>BIGINTUNSIGNEDThe unsignedTypes.BIGINTtype.static DataType<byte[]>BINARYTheTypes.BINARYtype.static DataType<java.lang.Boolean>BITTheTypes.BITtype.static DataType<byte[]>BLOBTheTypes.BLOBtype.static DataType<java.lang.Boolean>BOOLEANTheTypes.BOOLEANtype.static DataType<java.lang.String>CHARTheTypes.CHARtype.static DataType<java.lang.String>CLOBTheTypes.CLOBtype.static DataType<java.sql.Date>DATETheTypes.DATEtype.static DataType<java.math.BigDecimal>DECIMALTheTypes.DECIMALtype.static DataType<java.math.BigInteger>DECIMAL_INTEGERThe zero-scaleTypes.DECIMALtype.static DataType<java.lang.Double>DOUBLETheTypes.DOUBLEtype.static DataType<java.lang.Double>FLOATTheTypes.FLOATtype.static DataType<java.time.Instant>INSTANTATypes.TIMESTAMP_WITH_TIMEZONEtype that uses UTC as time zone.static DataType<java.lang.Integer>INTEGERTheTypes.INTEGERtype.static DataType<UInteger>INTEGERUNSIGNEDThe unsignedTypes.INTEGERtype.static DataType<YearToSecond>INTERVALThe SQL standardINTERVAL YEAR TO SECONDdata type.static DataType<DayToSecond>INTERVALDAYTOSECONDThe SQL standardINTERVAL DAY TO SECONDdata type.static DataType<YearToMonth>INTERVALYEARTOMONTHThe SQL standardINTERVAL YEAR TO MONTHdata type.static DataType<JSON>JSONTheJSONtype.static DataType<JSONB>JSONBTheJSONBtype.static DataType<java.time.LocalDate>LOCALDATETheTypes.DATEtype.static DataType<java.time.LocalDateTime>LOCALDATETIMETheTypes.TIMESTAMPtype.static DataType<java.time.LocalTime>LOCALTIMETheTypes.TIMEtype.static DataType<java.lang.String>LONGNVARCHARTheTypes.LONGNVARCHARtype.static DataType<byte[]>LONGVARBINARYTheTypes.LONGVARBINARYtype.static DataType<java.lang.String>LONGVARCHARTheTypes.LONGVARCHARtype.static DataType<java.lang.String>NCHARTheTypes.NCHARtype.static DataType<java.lang.String>NCLOBTheTypes.NCLOBtype.static DataType<java.math.BigDecimal>NUMERICTheTypes.NUMERICtype.static DataType<java.lang.String>NVARCHARTheTypes.NVARCHARtype.static DataType<java.time.OffsetDateTime>OFFSETDATETIMETheTypes.TIMESTAMP_WITH_TIMEZONEtype.static DataType<java.time.OffsetTime>OFFSETTIMETheTypes.TIME_WITH_TIMEZONEtype.static DataType<java.lang.Object>OTHERTheTypes.OTHERtype.static DataType<java.lang.Float>REALTheTypes.REALtype.static DataType<Record>RECORDTheTypes.STRUCTtype.static DataType<Result<Record>>RESULTTheResultSettype.static DataType<RowId>ROWIDTheTypes.ROWIDtype.static DataType<java.lang.Short>SMALLINTTheTypes.SMALLINTtype.static DataType<UShort>SMALLINTUNSIGNEDThe unsignedTypes.SMALLINTtype.static DataType<java.sql.Time>TIMETheTypes.TIMEtype.static DataType<java.sql.Timestamp>TIMESTAMPTheTypes.TIMESTAMPtype.static DataType<java.time.OffsetDateTime>TIMESTAMPWITHTIMEZONETheTypes.TIMESTAMP_WITH_TIMEZONEtype.static DataType<java.time.OffsetTime>TIMEWITHTIMEZONETheTypes.TIME_WITH_TIMEZONEtype.static DataType<java.lang.Byte>TINYINTTheTypes.TINYINTtype.static DataType<UByte>TINYINTUNSIGNEDThe unsignedTypes.TINYINTtype.static DataType<java.util.UUID>UUIDTheUUIDtype.static DataType<byte[]>VARBINARYTheTypes.VARBINARYtype.static DataType<java.lang.String>VARCHARTheTypes.VARCHARtype.
 - 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description static DataType<byte[]>BINARY(int length)TheTypes.BINARYtype.static DataType<byte[]>BLOB(int length)TheTypes.BLOBtype.static DataType<java.lang.String>CHAR(int length)TheTypes.CHARtype.static DataType<java.lang.String>CLOB(int length)TheTypes.CLOBtype.static DataType<java.math.BigDecimal>DECIMAL(int precision)TheTypes.DECIMALtype.static DataType<java.math.BigDecimal>DECIMAL(int precision, int scale)TheTypes.DECIMALtype.static DataType<java.math.BigInteger>DECIMAL_INTEGER(int precision)The zero-scaleTypes.DECIMALtype.static DataType<java.time.Instant>INSTANT(int precision)ATypes.TIMESTAMP_WITH_TIMEZONEtype that uses UTC as time zone.static DataType<java.lang.String>LONGNVARCHAR(int length)TheTypes.LONGNVARCHARtype.static DataType<byte[]>LONGVARBINARY(int length)TheTypes.LONGVARBINARYtype.static DataType<java.lang.String>LONGVARCHAR(int length)TheTypes.LONGVARCHARtype.static DataType<java.lang.String>NCHAR(int length)TheTypes.NCHARtype.static DataType<java.lang.String>NCLOB(int length)TheTypes.NCLOBtype.static DataType<java.math.BigDecimal>NUMERIC(int precision)TheTypes.NUMERICtype.static DataType<java.math.BigDecimal>NUMERIC(int precision, int scale)TheTypes.NUMERICtype.static DataType<java.lang.String>NVARCHAR(int length)TheTypes.NVARCHARtype.static DataType<java.time.OffsetDateTime>OFFSETDATETIME(int precision)TheTypes.TIMESTAMP_WITH_TIMEZONEtype.static DataType<java.time.OffsetTime>OFFSETTIME(int precision)TheTypes.TIME_WITH_TIMEZONEtype.static DataType<java.sql.Time>TIME(int precision)TheTypes.TIMEtype.static DataType<java.sql.Timestamp>TIMESTAMP(int precision)TheTypes.TIMESTAMPtype.static DataType<java.time.OffsetDateTime>TIMESTAMPWITHTIMEZONE(int precision)TheTypes.TIMESTAMP_WITH_TIMEZONEtype.static DataType<java.time.OffsetTime>TIMEWITHTIMEZONE(int precision)TheTypes.TIME_WITH_TIMEZONEtype.static DataType<byte[]>VARBINARY(int length)TheTypes.VARBINARYtype.static DataType<java.lang.String>VARCHAR(int length)TheTypes.VARCHARtype.
 
- 
- 
- 
Field Detail- 
VARCHARpublic static final DataType<java.lang.String> VARCHAR TheTypes.VARCHARtype.
 - 
CHARpublic static final DataType<java.lang.String> CHAR TheTypes.CHARtype.
 - 
LONGVARCHARpublic static final DataType<java.lang.String> LONGVARCHAR TheTypes.LONGVARCHARtype.
 - 
CLOBpublic static final DataType<java.lang.String> CLOB TheTypes.CLOBtype.
 - 
NVARCHARpublic static final DataType<java.lang.String> NVARCHAR TheTypes.NVARCHARtype.
 - 
NCHARpublic static final DataType<java.lang.String> NCHAR TheTypes.NCHARtype.
 - 
LONGNVARCHARpublic static final DataType<java.lang.String> LONGNVARCHAR TheTypes.LONGNVARCHARtype.
 - 
NCLOBpublic static final DataType<java.lang.String> NCLOB TheTypes.NCLOBtype.
 - 
BOOLEANpublic static final DataType<java.lang.Boolean> BOOLEAN TheTypes.BOOLEANtype.
 - 
BITpublic static final DataType<java.lang.Boolean> BIT TheTypes.BITtype.
 - 
TINYINTpublic static final DataType<java.lang.Byte> TINYINT TheTypes.TINYINTtype.
 - 
SMALLINTpublic static final DataType<java.lang.Short> SMALLINT TheTypes.SMALLINTtype.
 - 
INTEGERpublic static final DataType<java.lang.Integer> INTEGER TheTypes.INTEGERtype.
 - 
BIGINTpublic static final DataType<java.lang.Long> BIGINT TheTypes.BIGINTtype.
 - 
DECIMAL_INTEGERpublic static final DataType<java.math.BigInteger> DECIMAL_INTEGER The zero-scaleTypes.DECIMALtype.
 - 
TINYINTUNSIGNEDpublic static final DataType<UByte> TINYINTUNSIGNED The unsignedTypes.TINYINTtype.
 - 
SMALLINTUNSIGNEDpublic static final DataType<UShort> SMALLINTUNSIGNED The unsignedTypes.SMALLINTtype.
 - 
INTEGERUNSIGNEDpublic static final DataType<UInteger> INTEGERUNSIGNED The unsignedTypes.INTEGERtype.
 - 
DOUBLEpublic static final DataType<java.lang.Double> DOUBLE TheTypes.DOUBLEtype.
 - 
FLOATpublic static final DataType<java.lang.Double> FLOAT TheTypes.FLOATtype.
 - 
REALpublic static final DataType<java.lang.Float> REAL TheTypes.REALtype.
 - 
NUMERICpublic static final DataType<java.math.BigDecimal> NUMERIC TheTypes.NUMERICtype.
 - 
DECIMALpublic static final DataType<java.math.BigDecimal> DECIMAL TheTypes.DECIMALtype.
 - 
DATEpublic static final DataType<java.sql.Date> DATE TheTypes.DATEtype.
 - 
TIMESTAMPpublic static final DataType<java.sql.Timestamp> TIMESTAMP TheTypes.TIMESTAMPtype.
 - 
TIMEpublic static final DataType<java.sql.Time> TIME TheTypes.TIMEtype.
 - 
INTERVALpublic static final DataType<YearToSecond> INTERVAL The SQL standardINTERVAL YEAR TO SECONDdata type.
 - 
INTERVALYEARTOMONTHpublic static final DataType<YearToMonth> INTERVALYEARTOMONTH The SQL standardINTERVAL YEAR TO MONTHdata type.
 - 
INTERVALDAYTOSECONDpublic static final DataType<DayToSecond> INTERVALDAYTOSECOND The SQL standardINTERVAL DAY TO SECONDdata type.
 - 
LOCALDATEpublic static final DataType<java.time.LocalDate> LOCALDATE TheTypes.DATEtype.
 - 
LOCALTIMEpublic static final DataType<java.time.LocalTime> LOCALTIME TheTypes.TIMEtype.
 - 
LOCALDATETIMEpublic static final DataType<java.time.LocalDateTime> LOCALDATETIME TheTypes.TIMESTAMPtype.
 - 
OFFSETTIMEpublic static final DataType<java.time.OffsetTime> OFFSETTIME TheTypes.TIME_WITH_TIMEZONEtype.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 inOffsetDateTime). 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.
 - 
OFFSETDATETIMEpublic static final DataType<java.time.OffsetDateTime> OFFSETDATETIME TheTypes.TIMESTAMP_WITH_TIMEZONEtype.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 inOffsetDateTime). 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.
 - 
TIMEWITHTIMEZONEpublic static final DataType<java.time.OffsetTime> TIMEWITHTIMEZONE TheTypes.TIME_WITH_TIMEZONEtype.An alias for OFFSETTIME
 - 
TIMESTAMPWITHTIMEZONEpublic static final DataType<java.time.OffsetDateTime> TIMESTAMPWITHTIMEZONE TheTypes.TIMESTAMP_WITH_TIMEZONEtype.An alias for OFFSETDATETIME
 - 
INSTANTpublic static final DataType<java.time.Instant> INSTANT ATypes.TIMESTAMP_WITH_TIMEZONEtype that uses UTC as time zone.Neither JDBC, nor most SQL databases support the INSTANTdata 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'sTIMESTAMP WITH TIME ZONEdata 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.
 - 
BINARYpublic static final DataType<byte[]> BINARY TheTypes.BINARYtype.
 - 
VARBINARYpublic static final DataType<byte[]> VARBINARY TheTypes.VARBINARYtype.
 - 
LONGVARBINARYpublic static final DataType<byte[]> LONGVARBINARY TheTypes.LONGVARBINARYtype.
 - 
BLOBpublic static final DataType<byte[]> BLOB TheTypes.BLOBtype.
 - 
OTHERpublic static final DataType<java.lang.Object> OTHER TheTypes.OTHERtype.
 - 
RESULTpublic static final DataType<Result<Record>> RESULT TheResultSettype.This is not a SQL or JDBC standard. This type emulates REF CURSOR types and similar constructs 
 - 
UUIDpublic static final DataType<java.util.UUID> UUID TheUUIDtype.This is not a SQL or JDBC standard. This type handles UUID types where they are supported 
 - 
JSONpublic static final DataType<JSON> JSON TheJSONtype.This is not a SQL or JDBC standard. This type handles JSON types where they are supported. 
 
- 
 - 
Method Detail- 
VARCHARpublic static final DataType<java.lang.String> VARCHAR(int length) TheTypes.VARCHARtype.
 - 
CHARpublic static final DataType<java.lang.String> CHAR(int length) TheTypes.CHARtype.
 - 
LONGVARCHARpublic static final DataType<java.lang.String> LONGVARCHAR(int length) TheTypes.LONGVARCHARtype.
 - 
CLOBpublic static final DataType<java.lang.String> CLOB(int length) TheTypes.CLOBtype.
 - 
NVARCHARpublic static final DataType<java.lang.String> NVARCHAR(int length) TheTypes.NVARCHARtype.
 - 
NCHARpublic static final DataType<java.lang.String> NCHAR(int length) TheTypes.NCHARtype.
 - 
LONGNVARCHARpublic static final DataType<java.lang.String> LONGNVARCHAR(int length) TheTypes.LONGNVARCHARtype.
 - 
NCLOBpublic static final DataType<java.lang.String> NCLOB(int length) TheTypes.NCLOBtype.
 - 
DECIMAL_INTEGERpublic static final DataType<java.math.BigInteger> DECIMAL_INTEGER(int precision) The zero-scaleTypes.DECIMALtype.
 - 
NUMERICpublic static final DataType<java.math.BigDecimal> NUMERIC(int precision) TheTypes.NUMERICtype.
 - 
NUMERICpublic static final DataType<java.math.BigDecimal> NUMERIC(int precision, int scale) TheTypes.NUMERICtype.
 - 
DECIMALpublic static final DataType<java.math.BigDecimal> DECIMAL(int precision) TheTypes.DECIMALtype.
 - 
DECIMALpublic static final DataType<java.math.BigDecimal> DECIMAL(int precision, int scale) TheTypes.DECIMALtype.
 - 
TIMESTAMPpublic static final DataType<java.sql.Timestamp> TIMESTAMP(int precision) TheTypes.TIMESTAMPtype.
 - 
TIMEpublic static final DataType<java.sql.Time> TIME(int precision) TheTypes.TIMEtype.
 - 
OFFSETTIMEpublic static final DataType<java.time.OffsetTime> OFFSETTIME(int precision) TheTypes.TIME_WITH_TIMEZONEtype.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 inOffsetDateTime). 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.
 - 
OFFSETDATETIMEpublic static final DataType<java.time.OffsetDateTime> OFFSETDATETIME(int precision) TheTypes.TIMESTAMP_WITH_TIMEZONEtype.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 inOffsetDateTime). 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.
 - 
TIMEWITHTIMEZONEpublic static final DataType<java.time.OffsetTime> TIMEWITHTIMEZONE(int precision) TheTypes.TIME_WITH_TIMEZONEtype.An alias for OFFSETTIME
 - 
TIMESTAMPWITHTIMEZONEpublic static final DataType<java.time.OffsetDateTime> TIMESTAMPWITHTIMEZONE(int precision) TheTypes.TIMESTAMP_WITH_TIMEZONEtype.An alias for OFFSETDATETIME
 - 
INSTANTpublic static final DataType<java.time.Instant> INSTANT(int precision) ATypes.TIMESTAMP_WITH_TIMEZONEtype that uses UTC as time zone.Neither JDBC, nor most SQL databases support the INSTANTdata 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'sTIMESTAMP WITH TIME ZONEdata 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.
 - 
BINARYpublic static final DataType<byte[]> BINARY(int length) TheTypes.BINARYtype.
 - 
VARBINARYpublic static final DataType<byte[]> VARBINARY(int length) TheTypes.VARBINARYtype.
 - 
LONGVARBINARYpublic static final DataType<byte[]> LONGVARBINARY(int length) TheTypes.LONGVARBINARYtype.
 - 
BLOBpublic static final DataType<byte[]> BLOB(int length) TheTypes.BLOBtype.
 
- 
 
-