| Databases InterBase (29) MS-SQL (5) mysql (37) Oracle (1) |
JDBC error message Illegal hour value for java.sql.Time type in value
Question: 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? Answer: This is a known bug in mysql 5.0A workaround is to convert this query to return a string. E.g. you can query concat('',timediff(NOW(),from_unixtime(max(t_time)))) Then the returned value will be a string instead of a time field and JDBC will not parse it.
Comments:
| ||||||||||||||||||