This is because DateTime not a standard Java type. If you mean the JodaTime type, try the following:
variant.setDiscoveryDate( new DateTime(rs.getTimestamp("discovery_dt_tm").getTime()) );
This will break if rs.getTimestamp returns null , so you can break it down into smaller operators and add checks for null .
Note that this can be simplified, since the DateTime constructor accepts java.util.Date , which Timestamp is a subclass of:
variant.setDiscoveryDate( new DateTime(rs.getTimestamp("discovery_dt_tm")) );
But this is also wrong, due to the poor construction of the Timestamp class (see javadoc for an explanation).
Stick to the first example (with getTime() )
source share