NoSuchMethodException using custom timestamp class

Hello,

I am developing a new Metabase DB driver. I’ve successfully compiled and installed the jar file (and my JDBC driver) and can issue successful native queries against my DB for columns of type ‘int’, ‘float’, and ‘varchar’.

However I get the following error querying ‘timestamp’ columns. Our JDBC driver uses custom classes for TIMESTAMP (com.ocient.jdbc.XGTimestamp) and TIME (com.ocient.jdbc.XGTime) column types. These both reside in the driver jar file.

{:type “native”,
native {:query “select localdatetime from weather.stations limit 10”, :template-tags {}},
database 6,
parameters [],
middleware {:js-int-to-string? true, :add-default-userland-constraints? true}},
status :failed,
class java.lang.NoSuchMethodException, <==============
stacktrace
[“java.base/java.lang.Class.getConstructor0(Unknown Source)”
“java.base/java.lang.Class.getConstructor(Unknown Source)”
“com.ocient.jdbc.XGResultSet.getObject(XGResultSet.java:1411)”
“com.mchange.v2.c3p0.impl.NewProxyResultSet.getObject(NewProxyResultSet.java:217)”
“–> driver.sql_jdbc.execute$get_object_of_class_thunk$fn__77593.invoke(execute.clj:278)”
.
.
.
“async.streaming_response$do_f_STAR_.invoke(streaming_response.clj:63)”
“async.streaming_response$do_f_async$fn__16055.invoke(streaming_response.clj:84)”],
context :ad-hoc,
error “java.time.LocalDateTime.(com.ocient.jdbc.XGTimestamp)”, <=================

I tried using the driver method that maps database types to base types, but had no luck with this.

Any help would be much appreciated!
Thanks!

Hello @hcalzaretta, take a look at the sql-jdbc read-column-thunk methods. There might be more elegant methods to address your issue, but I think it might be a potential starting point.

Thanks @enqueue! I tried implementing the read-column-thunk method but I got this error compiling the driver:

Unable to resolve symbol: read-column-thunk in this context

I'll have to do more digging into this.

Thanks for your help!
Hank Calzlaretta

1 Like