How to save time using java.sql.Date?

后端 未结 1 338
生来不讨喜
生来不讨喜 2021-01-29 08:27

Currently in my code I am using following setter method to save current date and time to DB. But its saving only date, not time.

emp.setJoiningDate(new java.sql         


        
1条回答
  •  太阳男子
    2021-01-29 09:05

    From oracle documentation on java.sql.Date

    ...SQL Date values do not have a time component.

    If you want time use java.sql.Timestamp

    0 讨论(0)
提交回复
热议问题