Mybatis JDBC与Mysql,Oracle数据类型之间的对应关系
JdbcType | Oracle | MySql |
---|---|---|
ARRAY | ||
BIGINT | BIGINT | |
BINARY | ||
BIT | ||
BLOB | BLOB | TINYBLOB,BLOB,MEDIUMBLOB,LONGBLOB |
BOOLEAN | TINYINT | |
CHAR | CHAR | CHAR |
CLOB | CLOB | |
CURSOR | ||
DATE | DATE | DATE |
DECIMAL | DECIMAL | DECIMAL |
DOUBLE | NUMBER | DOUBLE |
FLOAT | FLOAT | FLOAT |
INTEGER | INTEGER | INTEGER,INT |
LONGVARBINARY | ||
LONGVARCHAR | LONG VARCHAR | TEXT,MEDIUMTEXT,LONGTEXT |
NCHAR | NCHAR | |
NCLOB | NCLOB | |
NULL | ||
NUMERIC | NUMERIC,NUMBER | NUMERIC |
NVARCHAR | ||
OTHER | ||
REAL | REAL | REAL |
SMALLINT | SMALLINT | SMALLINT |
STRUCT | ||
TIME | TIME | |
TIMESTAMP | TIMESTAMP | TIMESTAMP,DATETIME |
TINYINT | TINYINT | |
UNDEFINED | ||
VARBINARY | ||
VARCHAR | VARCHAR | VARCHAR,TINYTEXT |
JAVA Type与JDBC之间的对应关系:
JdbcType | javaType |
---|---|
CHAR | java.lang.String |
VARCHAR | java.lang.String |
LONGVARCHAR | java.lang.String |
NUMERIC | java.math.BigDecimal |
DECIMAL | java.math.BigDecimal |
BIT | boolean |
BOOLEAN | boolean,java.lang.Boolean |
TINYINT | byte,java.lang.Byte |
SMALLINT | short ,java.lang.Short |
INTEGER | int ,java.lang.Integer |
BIGINT | long,java.lang.Long |
REAL | float ,java.lang.Float |
FLOAT | double, java.lang.Double |
DOUBLE | double ,java.lang.Double |
BINARY | byte[] |
VARBINARY | byte[] |
LONGVARBINARY | byte[] |
DATE | java.sql.Date |
TIME | java.sql.Time |
TIMESTAMP | java.sql.Timestamp |
CLOB | java.sql.Clob |
BLOB | java.sql.Blob |
ARRAY | java.sql.Array |
DISTINCT | |
STRUCT | java.sql.Struct |
REF | java.sql.Ref |
DATALINK | |