JPA TemporalType.Date giving wrong date

前端 未结 6 1115

I have a class that has a date field representing a \"valid from\" date for a piece of data. It is defined like this:

@Temporal( TemporalType.DATE )
private          


        
6条回答
  •  离开以前
    2020-12-04 17:54

    Had the same problem with SQL Server. The problem was an old SQL JDBC driver. Had sqljdbc4.jar from April 2010 which was SQL 2000 compatible and had the problem with dates going back one or two days. Then updated to the latest driver or even to one from 2012 and the problem went away.

提交回复
热议问题