| От | Chris Ryan |
|---|---|
| Тема | JDBC and Timestamps |
| Дата | |
| Msg-id | 398C07F5.FE194B49@greatbridge.com обсуждение исходный текст |
| Список | pgsql-interfaces |
I'm working on a project where I update/insert/select records through JDBC and I'm noticing problems with the timestamp fields. The JDBC driver when writing a Timestamp value to postgres is passing the value to the backend as a String in the following format "yyyy-mm-dd hh:mm:ss.fffffffff" <-- the last part .fffffffff is nanosecs. When Postgres reads this is things it is millisecs so converts it and appends the timezone. Now when the JDBC driver reads the value back in it is trying to do a date conversion from a string using the format "yyyy-mm-dd hh:mm:sszzz" which has timezone but no millisecs. The different formats of course cause exceptions to be generated. I tried using the setLenient(true) but this didn't make any difference. Chris Ryan
В списке pgsql-interfaces по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера