> ResultSet rs = pstmt.executeQuery("select (final-initial) as diff
> from test_interval");
> while (rs.next() )
> {
> String str = (String)rs.getString(1);
>
> assertNotNull(str);
> str = (String)rs.getObject(1);
> assertNotNull(str);
> }
> }
The difference of two timestamps is an interval, a type which has no
equivalent Java class. The driver tries to determine a custom class
mapping (like those for the geometry types) in
AbstractJdbc1Connection.getObject(String type, String value)
which has a bug in it. I'm not sure I agree with your expectation that it
return a String, but that is certainly a position which could be argued.
I would have expected this to throw an Exception indicating that it
couldn't determine what to do with it. Another option would be to provide
a PGInterval class and map it appropriately.
Kris Jurka