搜索

此内容没有您所选择的语言版本。

Chapter 3. Data Types

download PDF

3.1. Supported Types

JBoss Data Virtualization supports a core set of runtime types. Runtime types can be different from semantic types defined in type fields at design time. The runtime type can also be specified at design time or it will be automatically chosen as the closest base type to the semantic type.

Note

Even if a type is declared with a length, precision, or scale argument, these restrictions are effectively ignored by the runtime system, but may be enforced by OData, ODBC or JDBC.
Table 3.1. JBoss Data Virtualization Runtime Types
Type Description Java Runtime Class JDBC Type ODBC Type
string or varchar variable length character string with a maximum length of 4000. Note that the length cannot be explicitly set with the type declaration, e.g. varchar(100) is invalid. java.lang.String VARCHAR VARCHAR
varbinary variable length binary string with a maximum length of 8192. Note that the length cannot be explicitly set with the type declaration, e.g. varbinary(100) is invalid. byte[] [a] VARBINARY VARBINARY
char a single Unicode character java.lang.Character CHAR CHAR
boolean a single bit, or Boolean, that can be true, false, or null (unknown) java.lang.Boolean BIT SMALLINT
byte or tinyint numeric, integral type, signed 8-bit java.lang.Byte TINYINT SMALLINT
short or smallint numeric, integral type, signed 16-bit java.lang.Short SMALLINT SMALLINT
integer or serial numeric, integral type, signed 32-bit. The serial type also implies not null and has an auto-incrementing value that starts at 1. Serial types are not automatically UNIQUE. java.lang.Integer INTEGER INTEGER
long or bigint numeric, integral type, signed 64-bit java.lang.Long BIGINT NUMERIC
biginteger numeric, integral type, arbitrary precision of up to 1000 digits java.math.BigInteger NUMERIC NUMERIC
float or real numeric, floating point type, 32-bit IEEE 754 floating-point numbers java.lang.Float REAL FLOAT
double numeric, floating point type, 64-bit IEEE 754 floating-point numbers java.lang.Double DOUBLE DOUBLE
bigdecimal or decimal numeric, floating point type, arbitrary precision of up to 1000 digits. Note that the precision and scale cannot be explicitly set with the type literal, e.g. decimal(38, 2). java.math.BigDecimal NUMERIC NUMERIC
date datetime, representing a single day (year, month, day) java.sql.Date DATE DATE
time datetime, representing a single time (hours, minutes, seconds, milliseconds) java.sql.Time TIME TIME
timestamp datetime, representing a single date and time (year, month, day, hours, minutes, seconds, milliseconds, nanoseconds) java.sql.Timestamp TIMESTAMP TIMESTAMP
object any arbitrary Java object, must implement java.lang.Serializable Any JAVA_OBJECT VARCHAR
blob binary large object, representing a stream of bytes java.sql.Blob [b] BLOB VARCHAR
clob character large object, representing a stream of characters java.sql.Clob [c] CLOB VARCHAR
xml XML document java.sql.SQLXML [d] JAVA_OBJECT VARCHAR
geometry Geospatial Object java.sql.Blob [e] BLOB BLOB
[a] The runtime type is org.teiid.core.types.BinaryType. Translators will need to explicitly handle BinaryType values. UDFs will instead have a byte[] value passed.
[b] The concrete type is expected to be org.teiid.core.types.BlobType
[c] The concrete type is expected to be org.teiid.core.types.ClobType
[d] The concrete type is expected to be org.teiid.core.types.XMLType
[e] The concrete type is expected to be org.teiid.core.types.GeometryType
Red Hat JBoss Data Virtualization also supports arrays. Designate an array by adding [] to the type declaration for each array dimension.
string[]

integer[][]

Note

This feature is limited at present.

Important

Red Hat JBoss Data Virtualization normally handles arrays in memory. Red Hat advises you not to reply on large array values. Also arrays of lobs are not not handled correctly when serialized.
Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.