DelphiFAQ Home Search:
General :: Databases :: mysql
General information about mysql - how to get around the differences between version 3.33 an 4, how to do stuff that you think you need a nested query for etc.


This list is sorted by recent document popularity (not total page views).
New documents will first appear at the bottom.

Featured Article

JDBC error message Illegal hour value for java.sql.Time type in value


I am getting a mysql exception with JDBC:

javax.servlet.ServletException: java.sql.SQLException: java.sql.SQLException: Illegal hour value '94' for java.sql.Time type in value '94:42:06.

The statement runs OK in the mysql shell (see below).
What can I do?


This is a known bug in mysql 5.0

A workaround is to convert this query to return a string. E.g. you can query


Then the returned value will be a string instead of a time field and JDBC will not parse it.

mysql> select timediff(NOW(),from_unixtime(max(t_time))) from [..]
 | timediff(NOW(),from_unixtime(max(t_time))) |
 | 94:41:48                                   | 
 1 row in set (0.09 sec)

Generated 8:00:28 on Jul 8, 2020