Choosing between java.util.Date or java.sql.Date

前端 未结 4 1567
-上瘾入骨i
-上瘾入骨i 2020-12-14 09:52

Should I use java.util.Date or java.sql.Date?

I have a VisualFox database and I have retrieved the entities with the IntelliJ Idea wizard using an appropiate jdbc ty

4条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-14 10:21

    Well, according to this article you can use javax.sql.Date without @Temporal annotation which can save some coding from you. However java.util.Date is easier to use across your whole application.

    So I would use

    @Column(name = "date")
    @Temporal(TemporalType.DATE)
    private java.util.Date date;
    

提交回复
热议问题