Re: Literal vs parameterized 'timestamp with time zone' value
| От | Heikki Linnakangas |
|---|---|
| Тема | Re: Literal vs parameterized 'timestamp with time zone' value |
| Дата | |
| Msg-id | 46767EC3.3020505@enterprisedb.com обсуждение исходный текст |
| Ответ на | Literal vs parameterized 'timestamp with time zone' value (Christopher Hunt <huntc@internode.on.net>) |
| Ответы |
Re: Literal vs parameterized 'timestamp with time zone' value
|
| Список | pgsql-jdbc |
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
В списке pgsql-jdbc по дате отправления: