附录:类型映射
根据 Java 类型获取对应的 JDBC Type
Java 类型 | JDBC 类型 |
---|---|
java.lang.Boolean , boolean
|
Types.BIT
|
java.lang.Byte , byte
|
Types.TINYINT
|
java.lang.Short , short , java.time.Year , java.time.Month
|
Types.SMALLINT
|
java.lang.Integer , int
|
Types.INTEGER
|
java.lang.Long , long
|
Types.BIGINT
|
java.lang.Float , float
|
Types.FLOAT
|
java.lang.Double , double
|
Types.DOUBLE
|
java.lang.Character , char
|
Types.CHAR
|
java.util.Date , java.sql.Timestamp , java.time.Instant , java.time.LocalDateTime , java.time.ZonedDateTime , java.time.chrono.JapaneseDate , java.time.OffsetDateTime , java.time.OffsetTime
|
Types.TIMESTAMP
|
java.sql.Date , java.time.LocalDate
|
Types.DATE
|
java.sql.Time , java.time.LocalTime
|
Types.TIME
|
java.time.YearMonth
|
Types.VARCHAR
|
java.lang.String
|
Types.VARCHAR
|
java.math.BigInteger
|
Types.BIGINT
|
java.math.BigDecimal
|
Types.DECIMAL
|
java.io.Reader
|
Types.CLOB
|
java.io.InputStream
|
Types.BLOB
|
java.lang.Byte[] , byte[]
|
Types.VARBINARY
|
java.net.URL
|
Types.DATALINK
|
java.lang.Object[]
|
Types.ARRAY
|
java.lang.Object
|
Types.JAVA_OBJECT
|
oracle.jdbc.OracleBlob
|
Types.BLOB
|
oracle.jdbc.OracleClob
|
Types.CLOB
|
oracle.jdbc.OracleNClob
|
Types.NCLOB
|
oracle.sql.DATE
|
Types.DATE
|
oracle.sql.TIMESTAMP
|
Types.TIMESTAMP
|
oracle.sql.TIMESTAMPTZ
|
Types.TIMESTAMP_WITH_TIMEZONE
|
oracle.sql.TIMESTAMPLTZ
|
Types.TIMESTAMP_WITH_TIMEZONE
|