我正在使用java來提取mysql中表中時間列的值。在java中解決時間錯誤的錯誤格式?
下面的代碼顯示我發送的查詢。
String query="select id,time from table where Hour(time)<=32 ";
ResultSet res = stmt.executeQuery(query);
while (res.next()) {
String id = res.getString(1);
Time tc = res.getTime("time");
System.out.println(tc);
}
時間值可以是負值(-56:00:00的意思,我們超越了一定的延時 的問題是,我得到:java.sql.SQLException:
java.sql.SQLException: Bad format
的時間「-05:49:48」在列2.
感謝您的幫助。
列[時間]的類型是什麼? – 2010-08-16 13:37:03