JDBC Data Type Mapping
The relationships among data types, Java variable types, and JDBC type indexes are as follows (ORA: Oracle-compatible; MYSQL: MySQL-compatible).
Compatibility Mode |
GaussDB Data Type |
Java Variable Type |
JDBC Type Index |
---|---|---|---|
ORA/MYSQL |
oid |
java.lang.Long |
java.sql.Types.BIGINT |
ORA/MYSQL |
numeric |
java.math.BigDecimal |
java.sql.Types.NUMERIC |
ORA/MYSQL |
tinyint |
java.lang.Integer |
java.sql.Types.TINYINT |
ORA/MYSQL |
smallint |
java.lang.Integer |
java.sql.Types.SMALLINT |
ORA/MYSQL |
bigint |
java.lang.Long |
java.sql.Types.BIGINT |
ORA/MYSQL |
float4 |
java.lang.Float |
java.sql.Types.REAL |
ORA/MYSQL |
float8 |
java.lang.Double |
java.sql.Types.DOUBLE |
ORA/MYSQL |
char |
java.lang.String |
java.sql.Types.CHAR |
ORA/MYSQL |
character |
java.lang.String |
java.sql.Types.CHAR |
ORA/MYSQL |
bpchar |
java.lang.String |
java.sql.Types.CHAR |
ORA/MYSQL |
character varying |
java.lang.String |
java.sql.Types.VARCHAR |
ORA/MYSQL |
varchar |
java.lang.String |
java.sql.Types.VARCHAR |
ORA/MYSQL |
text |
java.lang.String |
java.sql.Types.VARCHAR |
ORA/MYSQL |
name |
java.lang.String |
java.sql.Types.VARCHAR |
ORA/MYSQL |
bytea |
byte[] |
java.sql.Types.BINARY |
ORA/MYSQL |
blob |
java.sql.Blob |
java.sql.Types.BLOB |
ORA/MYSQL |
clob |
java.sql.Clob |
java.sql.Types.CLOB |
ORA/MYSQL |
boolean |
java.lang.Boolean |
java.sql.Types.BIT |
MYSQL |
date |
java.sql.Date |
java.sql.Types.DATE |
ORA/MYSQL |
time |
java.sql.Time |
java.sql.Types.TIME |
ORA/MYSQL |
timetz |
java.sql.Time |
java.sql.Types.TIME |
ORA/MYSQL |
timestamp |
java.sql.Timestamp |
java.sql.Types.TIMESTAMP |
ORA/MYSQL |
smalldatetime |
java.sql.Timestamp |
java.sql.Types.TIMESTAMP |
ORA/MYSQL |
timestamptz |
java.sql.Timestamp |
java.sql.Types.TIMESTAMP |
ORA/MYSQL |
refcursor |
java.sql.ResultSet |
java.sql.Types.REF_CURSOR java.sql.Types.OTHER -10 |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot