Christopher Hunt wrote:
> However if I use a parameter:
>
> PreparedStatement sqlStatement =
> sqlConnection.prepareStatement("select validtime from
> moving_object_status where validtime < ?");
> int columnIndex = 1;
> sqlStatement.setString(columnIndex++, "2005-06-08T20:05:45.825+0");
>
> No rows are returned.
>
> Can anyone explain the difference in results given a literal value and a
> parameterised value in this context?
I don't really have an explanation, but I would recommend using
setTimestamp instead of setString for timestamp values.
Maybe there's a time or timezone difference between client and server,
and in the former case the server setting is used, and in the latter,
the client setting?
--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com