Closed karlssor closed 1 year ago
workaround/hack with custom decoder in resources/META-INF/services/io.vertx.ext.jdbc.spi.JDBCDecoder
"works"
class WorkaroundOraTimestampDecoder : JDBCDecoderImpl() {
override fun decodeSpecificVendorType(valueProvider: SQLValueProvider, descriptor: JDBCColumnDescriptor): Any {
val value = valueProvider.apply(null)
if (value is TIMESTAMPTZ) {
return value.toOffsetDateTime()
}
return super.decodeSpecificVendorType(valueProvider, descriptor)
}
}
In fact, this is not a bug. The Oracle driver returns null
for JdbcType
of TIMESTAMP WITH TIMEZONE
columns.
You did the right thing by extending JDBCDecoderImpl
and implementing decodeSpecificVendorType
.
Version
4.3.5, 4.3.8, 4.4.1
Context
I encountered an exception which looks suspicious while getting the value of an Oracle database timestamp column from a vertx Row.
row.getOffsetDateTime produce an exception on being unable to cast result to OffsetDateTime.
using a "simple" row.get(OffsetDateTime, column) produce a null, which is unexpected as the column is valued with "29-MAY-23 07.02.24.027212000 AM UTC". And getValue a reference to the oracle timestamp object
Do you have a reproducer?
produce output
Steps to reproduce
Extra
oracle.database.jdbc 21.5.0.0