Skip to main content

MySql Timediff and JDBC (ConnectorJ) - Bad format for Time 'hhh:mm:ss' in column x

MySQL Types to Java Types for ResultSet.getObject().
MySQL Type Name Return value of GetColumnClassName Retur
TIME TIME java.sql.Time

http://dev.mysql.com/doc/refman/5.1/en/connector-j-reference-type-conversions.html

ResultSet.getTime() will fail with an SQLException: "Bad format for Time 'hhh:mm:ss' in
column x"
http://bugs.mysql.com/bug.php?id=11154

Surprisingly
(Shockingly) ResultSet.getString() was also throwing the same exception "Bad
format for Time".

http://forums.sun.com/thread.jspa?threadID=5149261


Comments

Popular posts from this blog

Java and “\u” ( blackslash u )

This article is related to escaping of “\u” backslash u [Unicode character] in Java Problem Statement: I have a string which consists of a DOS path something like "\sample\user_data\example".The “\u” (backslash u) in “\user_data” above gives “an invalid Unicode” JavaScript error in IE and hence my page isn’t displayed. I tried to replace “\u” (backslash u) in the string with something like "\ u"(backslash u) as I was not able to escape it. This also does not work . Java complier does not allow “\u” (backslash u) character and gives "Invalid unicode character sequence" error when I use it with replaceAll. Que 1: Can I escape the \u character some how in Java or JavaScript? Que 2: How can I replace all "\u" character in a string with something else like "\ u"? I have posted this query to some of the Java and JavaScript related groups. Here are the solutions I found Before going into the details about solution let us...

Every thing about ConcurrentHashMap

Why ConcurrentHashMap is better than Hashtable and just as good as a HashMap http://www.codercorp.com/blog/java/why-concurrenthashmap-is-better-than-hashtable-and-just-as-good-hashmap.html Why ConcurrentHashMap does not support null values http://anshuiitk.blogspot.com/2010/12/why-concurrenthashmap-does-not-support.html