PostgreSQL 9.2 JDBC driver uses client time zone?

前端 未结 5 1640
遥遥无期
遥遥无期 2020-12-09 09:38

I\'ve run into an interesting challenge using a PostgreSQL database with the PostgreSQL JDBC driver. It seems that the latest version of the driver, 9.2, uses the client

5条回答
  •  孤街浪徒
    2020-12-09 10:19

    The use of the local timezone as the default timezone is required by the JDBC standard (and API documentation), and is made explicit by PreparedStatement.setTimestamp. However it also applies to all other areas where JDBC sets or retrieves time related data.

    See also my answer to Is java.sql.Timestamp timezone specific?

提交回复
热议问题