Package io.vertx.jdbcclient.spi
Interface JDBCDecoder
-
- All Known Implementing Classes:
JDBCDecoderImpl
public interface JDBCDecoder
Represents for JDBC decoder from SQL value to Java valueThe default decoder provides the best efforts to convert
SQL type
to standardJava type
asJDBC 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
)- Since:
- 4.2.0
- See Also:
- Mapping of java.sql.Types to
SQL types,
JDBCDecoderImpl
,JDBCType
,SQLType
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Object
cast(Object value)
Try cast SQL value to standard Java value depends on standard JDBC 4.2 type mapping and compatible with VertxObject
decode(io.vertx.jdbcclient.impl.actions.JDBCColumnDescriptor descriptor, io.vertx.jdbcclient.impl.actions.SQLValueProvider valueProvider)
Convert the SQL value to Java value based on jdbc typeObject
parse(CallableStatement cs, int pos, JDBCColumnDescriptorProvider jdbcTypeLookup)
Parse SQL value to Java valueObject
parse(ResultSet rs, int pos, JDBCColumnDescriptorProvider jdbcTypeLookup)
Parse SQL value to Java value
-
-
-
Method Detail
-
parse
Object parse(ResultSet rs, int pos, JDBCColumnDescriptorProvider jdbcTypeLookup) throws SQLException
Parse SQL value to Java value- Parameters:
rs
- JDBC result setpos
- the Database column positionjdbcTypeLookup
- JDBCType provider- Returns:
- java value
- Throws:
SQLException
- if any error in parsing- Since:
- 4.2.2
- See Also:
ResultSet
,JDBCColumnDescriptorProvider
-
parse
Object parse(CallableStatement cs, int pos, JDBCColumnDescriptorProvider jdbcTypeLookup) throws SQLException
Parse SQL value to Java value- Parameters:
cs
- JDBC callable statementpos
- the parameter column positionjdbcTypeLookup
- JDBCType provider- Returns:
- java value
- Throws:
SQLException
- if any error in parsing- Since:
- 4.2.2
- See Also:
CallableStatement
,JDBCColumnDescriptorProvider
-
decode
Object decode(io.vertx.jdbcclient.impl.actions.JDBCColumnDescriptor descriptor, io.vertx.jdbcclient.impl.actions.SQLValueProvider valueProvider) throws SQLException
Convert the SQL value to Java value based on jdbc type- Parameters:
descriptor
- the JDBC column descriptorvalueProvider
- the value provider- Returns:
- java value
- Throws:
SQLException
- Since:
- 4.2.2
- See Also:
SQLValueProvider
,JDBCColumnDescriptor
-
cast
Object cast(Object value) throws SQLException
Try cast SQL value to standard Java value depends on standard JDBC 4.2 type mapping and compatible with VertxFor example: - java.sql.Time -> java.time.LocalTime - java.sql.Timestamp -> java.time.LocalDateTime
- Parameters:
value
- value- Returns:
- a presenter value
- Throws:
SQLException
- if any error when casting
-
-