public interface JDBCDecoder
The default decoder provides the best efforts to convert SQL type to standard Java type as JDBC 4.2 spec.
You can replace it to adapt to a specific SQL driver by creating your owns then includes in the SPI file (META-INF/services/io.vertx.ext.jdbc.spi.JDBCDecoder)
JDBCDecoderImpl,
JDBCType,
SQLType| Modifier and Type | Method and Description |
|---|---|
Object |
cast(Object value)
Try cast SQL value to standard Java value depends on standard JDBC 4.2 type mapping and compatible with Vertx
|
Object |
decode(io.vertx.jdbcclient.impl.actions.JDBCColumnDescriptor descriptor,
io.vertx.ext.jdbc.impl.actions.SQLValueProvider valueProvider)
Convert the SQL value to Java value based on jdbc type
|
Object |
parse(CallableStatement cs,
int pos,
JDBCColumnDescriptorProvider jdbcTypeLookup)
Parse SQL value to Java value
|
Object |
parse(ResultSet rs,
int pos,
JDBCColumnDescriptorProvider jdbcTypeLookup)
Parse SQL value to Java value
|
Object parse(ResultSet rs, int pos, JDBCColumnDescriptorProvider jdbcTypeLookup) throws SQLException
rs - JDBC result setpos - the Database column positionjdbcTypeLookup - JDBCType providerSQLException - if any error in parsingResultSet,
JDBCColumnDescriptorProviderObject parse(CallableStatement cs, int pos, JDBCColumnDescriptorProvider jdbcTypeLookup) throws SQLException
cs - JDBC callable statementpos - the parameter column positionjdbcTypeLookup - JDBCType providerSQLException - if any error in parsingCallableStatement,
JDBCColumnDescriptorProviderObject decode(io.vertx.jdbcclient.impl.actions.JDBCColumnDescriptor descriptor, io.vertx.ext.jdbc.impl.actions.SQLValueProvider valueProvider) throws SQLException
descriptor - the JDBC column descriptorvalueProvider - the value providerSQLExceptionSQLValueProvider,
JDBCColumnDescriptorObject cast(Object value) throws SQLException
For example: - java.sql.Time -> java.time.LocalTime - java.sql.Timestamp -> java.time.LocalDateTime
value - valueSQLException - if any error when castingCopyright © 2023 Eclipse. All rights reserved.