Skip to main content

8.1 Java/JDBC Type Mapping

When no JDBC type is explicitly specified, dbVisitor automatically selects the JDBC type corresponding to the Java type from the mapping table.

Default Mapping Table​

Java TypeJDBC Type
java.lang.Boolean, booleanTypes.BIT
java.lang.Byte, byteTypes.TINYINT
java.lang.Short, short, java.time.Year, java.time.MonthTypes.SMALLINT
java.lang.Integer, intTypes.INTEGER
java.lang.Long, long, java.math.BigIntegerTypes.BIGINT
java.lang.Float, floatTypes.FLOAT
java.lang.Double, doubleTypes.DOUBLE
java.lang.Character, charTypes.CHAR
java.sql.Date, java.time.LocalDate, oracle.sql.DATETypes.DATE
java.sql.Time, java.time.LocalTimeTypes.TIME
java.util.Date, java.sql.Timestamp, java.time.Instant, java.time.LocalDateTime, java.time.chrono.JapaneseDate, oracle.sql.TIMESTAMPTypes.TIMESTAMP
java.time.OffsetDateTime, java.time.ZonedDateTime, oracle.sql.TIMESTAMPTZ, oracle.sql.TIMESTAMPLTZTypes.TIMESTAMP_WITH_TIMEZONE
java.time.OffsetTimeTypes.TIME_WITH_TIMEZONE
java.lang.String, java.time.YearMonthTypes.VARCHAR
java.math.BigDecimalTypes.DECIMAL
java.io.Reader, oracle.jdbc.OracleClobTypes.CLOB
java.io.InputStream, oracle.jdbc.OracleBlobTypes.BLOB
oracle.jdbc.OracleNClobTypes.NCLOB
java.lang.Byte[], byte[]Types.VARBINARY
java.net.URL, java.net.URITypes.DATALINK
java.lang.Object[]Types.ARRAY
java.lang.ObjectTypes.JAVA_OBJECT

byte[] is a primitive array and Byte[] is a boxed array. General JDBC parameter binding treats both as binary values, not as a database ARRAY. If an adapter assigns schema-specific semantics, its data-source documentation states that explicitly. For example, Milvus uses the target vector schema to distinguish numeric elements, packed encodings, and Int8 components.

Further Reading​

The table above describes default type selection for parameter binding; it does not mean every database supports the corresponding storage types. For database column types, JDBC result types, available Java mappings and usage limits, see the data source's type support documentation:

For handler matching rules and built-in implementations, see Basic Type Handlers.