JeffersonLab/rcdb

trouble accessing dates via Java API

Opened this issue · 0 comments

java.sql.Time does not provide the date (getDate() is deprecated); thus it does not seem to be possible to get the date from a Time condition:

fun toTime(): java.sql.Time {

Reproducer in groovy:

import org.rcdb.RCDB
def db = RCDB.createProvider('mysql://rcdb@clasdb-farm.jlab.org/rcdb')
db.connect()
def result = db.getCondition(5052, 'run_start_time')
println "time = ${result.toTime()}"
println "date = ${result.toTime().getDate()}" // fails

Is there some other way to get the date with the Java API?