I've retrieved a Time value from a table and compared it to the current Time. Why don't the java.sql.Time methods before() and after() work properly?

Joe Sam Shirah

There is one root cause to this problem, although it may come from two different directions. In order for Time comparisons to work properly, the Time objects must be normalized ( see How do I create a java.sql.Time object? ).

If the application doesn't normalize its Time object OR if the JDBC driver does not normalize returned Time objects ( this is a bug, but I know of one otherwise production quality driver that does not do this ), before() and after() will show seemingly erroneous results.