Hello
I am using org.gjt.mm.mysql.Driver to connect a web-app to a mysql database. I ran into an
error, I could use some help with.
I have a database that has a timestamp field
CREATE TABLE FOO (
create_date TIMESTAMP,
approved_date TIMESTAMP,
) TYPE=InnoDB;
Now when I insert into foo, I insert the create_date of course when new foo records are
inserted. But I do not insert anything for the approved_date, because the foo is not
known yet. Anyway what I found was a problem. When using the driver, and I say select *
from foo, I get the following error, which makes sense, because it says it cannot convert
00000000000000 which is null of course.
So is this a driver problem, or just the way the driver handles the data? Any ideas how to
get around this?
Thanks,
Scott
java.sql.SQLException: Cannot convert value '00000000000000' from column 12 to T
IMESTAMP.
at com.mysql.jdbc.ResultSet.getTimestampFromString(ResultSet.java:5294)
at com.mysql.jdbc.ResultSet.getStringInternal(ResultSet.java:2217)
at com.mysql.jdbc.ResultSet.getString(ResultSet.java:2132)
at com.skp.sql.Row.<init>(Row.java:27)
at com.skp.sql.DBConn.getRows(DBConn.java:255)
at com.skp.sql.DBConn.getRows(DBConn.java:220)
at com.skp.bean.AssetBean.ShowAllAssets(AssetBean.java:30)
at com.skp.bean.AssetBean.<init>(AssetBean.java:19)
at com.skp.taglib.displayAssetTag.doStartTag(displayAssetTag.java:43)
at org.apache.jsp.manageAssets_jsp._jspx_meth_menu_displayAssets_0(manag
eAssets_jsp.java:243)
at org.apache.jsp.manageAssets_jsp._jspService(manageAssets_jsp.java:170
)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:92)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:809)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper
.java:162)