java.time
With the release of Java SE 8 in March 2014, the outdated and error-prone legacy Date-Time API (java.util
Date-Time types and their formatting type, SimpleDateFormat
etc.) was supplanted by java.time
, the modern Date-Time API*. The following table depicts the mapping of ANSI SQL types with java.time
types:
ANSI SQL |
Java SE 8 |
DATE |
LocalDate |
TIME |
LocalTime |
TIMESTAMP |
LocalDateTime |
TIME WITH TIMEZONE |
OffsetTime |
TIMESTAMP WITH TIMEZONE |
OffsetDateTime |
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…