Re: anyone know why this is failing
От | Kris Jurka |
---|---|
Тема | Re: anyone know why this is failing |
Дата | |
Msg-id | Pine.LNX.4.33.0402102225270.26959-100000@leary.csoft.net обсуждение исходный текст |
Ответ на | anyone know why this is failing (Dave Cramer <pg@fastcrypt.com>) |
Список | pgsql-jdbc |
> 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
В списке pgsql-jdbc по дате отправления: