InterviewSolution
| 1. |
How Can I Tell If My Jdbc Driver Normalizes Java.sql.date And Java.sql.time Objects? |
|
Answer» To actually determine the values, the OBJECTS must be converted to a java.util.Date and examined. See What does normalization mean for java.sql.Date and java.sql.Time? for the definition of normalization. NOTICE that even a debugger will not show whether these objects have been normalized, since the getXXX methods in java.sql.Date for time elements and in java.sql.Time for date elements throw an exception. So, while a java.sql.Date may show 2001-07-26, it's normalized only if the java.util.Date value is: and while a java.sql.Time may show 14:01:00, it's normalized only if the java.util.Date value is: To actually determine the values, the objects must be converted to a java.util.Date and examined. See What does normalization mean for java.sql.Date and java.sql.Time? for the definition of normalization. Notice that even a debugger will not show whether these objects have been normalized, since the getXXX methods in java.sql.Date for time elements and in java.sql.Time for date elements throw an exception. So, while a java.sql.Date may show 2001-07-26, it's normalized only if the java.util.Date value is: and while a java.sql.Time may show 14:01:00, it's normalized only if the java.util.Date value is: |
|