Bug #18308 | Cannot convert value '0000-00-00 00:00:00' from column 2 | ||
---|---|---|---|
Submitted: | 17 Mar 2006 13:57 | Modified: | 28 Mar 2006 15:07 |
Reporter: | Jeppe Skovbon | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | Connector / J | Severity: | S3 (Non-critical) |
Version: | mysql-connector-java-3.1.10-bin.jar | OS: | Windows (Windows XP) |
Assigned to: | CPU Architecture: | Any |
[17 Mar 2006 13:57]
Jeppe Skovbon
[27 Mar 2006 13:01]
Tonci Grgin
Thank's for your bug report. Can you please provide me with data dump?
[27 Mar 2006 13:47]
Jeppe Skovbon
Table Customer data dump
Attachment: customer_dump.sql (text/plain), 18.14 KiB.
[27 Mar 2006 13:51]
Jeppe Skovbon
Please be aware that the problem occurs in column 20, and not column 2... java.sql.SQLException: Cannot convert value '0000-00-00 00:00:00' from column 20 to TIMESTAMP
[28 Mar 2006 8:09]
Tonci Grgin
Thanks for additional info. Test environment: WinXP SP2, 4.1.18-nt-max-log, mysql-connector-java-3.1.12. I've been able to build test case but the error didn't show up: custID custInternID custFirstname custLastname custLocalNo custMobilNo custEmail custUsername custPassword custPwdIsChanged custIPRestrict custIPRestrictIsActive custAdminRights custIsExternal custRelationShip custRelationShipText custIsActive custIsDeleted custTimestampCreated custTimestampDeleted custTimestampChange depID custEmailInvitationIsSent custEmailInvitationDate compID compOwnerID usertypeID =========================================== 1 0 Admin JSF j_skovbon@hotmail.com jeppe1 Bj65tUZLhSyLLGj42lOKU70eCm0= true 127.0.0.2 false true false false true true null null 2006-02-18 02:22:55.0 0 true 2006-02-18 02:23:01.0 1 0 2 2 0 Jeppe234 Skovbon23444545 Jeppe j_skovbon@hotmail.com demoadm zQOQIhn2rXrRV3rlhGZKux9bLiY= true false true false false true true 2004-07-07 00:00:00.0 null 2006-02-17 23:32:34.0 0 true 2006-02-17 23:32:35.0 2 0 4 3 0 Jeppe Skovbon xxxx j_skovbon@hotmail.com demokantine1 demokantine2 true false true false false true true 2004-07-07 00:00:00.0 null 2006-02-02 17:00:59.0 0 true 2006-01-22 08:06:54.0 2 0 3 4 0 test4 test test j_skovbon@hotmail.com idafaktura1 M/PAlLyMDRLnU9khKkZpBUpXgOA= false false false false false true true 2004-07-07 00:00:00.0 null 2006-03-07 11:24:35.0 0 true 2006-03-07 11:24:38.0 3 0 5 custID custInternID custFirstname custLastname custLocalNo custMobilNo custEmail custUsername custPassword custPwdIsChanged custIPRestrict custIPRestrictIsActive custAdminRights custIsExternal custRelationShip custRelationShipText custIsActive custIsDeleted custTimestampCreated custTimestampDeleted custTimestampChange depID custEmailInvitationIsSent custEmailInvitationDate compID compOwnerID usertypeID =========================================== 1 0 Admin JSF j_skovbon@hotmail.com jeppe1 Bj65tUZLhSyLLGj42lOKU70eCm0= true 127.0.0.2 false true false false true true null null 2006-02-18 02:22:55.0 0 true 2006-02-18 02:23:01.0 1 0 2 2 0 Jeppe234 Skovbon23444545 Jeppe j_skovbon@hotmail.com demoadm zQOQIhn2rXrRV3rlhGZKux9bLiY= true false true false false true true 2004-07-07 00:00:00.0 null 2006-02-17 23:32:34.0 0 true 2006-02-17 23:32:35.0 2 0 4 3 0 Jeppe Skovbon xxxx j_skovbon@hotmail.com demokantine1 demokantine2 true false true false false true true 2004-07-07 00:00:00.0 null 2006-02-02 17:00:59.0 0 true 2006-01-22 08:06:54.0 2 0 3 4 0 test4 test test j_skovbon@hotmail.com idafaktura1 M/PAlLyMDRLnU9khKkZpBUpXgOA= false false false false false true true 2004-07-07 00:00:00.0 null 2006-03-07 11:24:35.0 0 true 2006-03-07 11:24:38.0 3 0 5 5 0 Jeppe Skovbon2 hjh''bjbj 61305045 j_skovbon@hotmail.com jesk98ac TiIirjt9I7HmHjTAaP5WXTtLdDk= true false false false false true true 2004-07-07 00:00:00.0 null 2006-03-10 00:00:00.0 2 true 2006-03-08 09:24:01.0 3 2 6 ... Maybe the problem is with connection string. It should include zeroDateTimeBehavior=convertToNull. con=DriverManager.getConnection("jdbc:mysql://localhost/test?zeroDateTimeBehavior=convertToNull","root","");
[28 Mar 2006 8:17]
Tonci Grgin
Additional info can be found at http://dev.mysql.com/doc/refman/5.0/en/cj-configuration-properties.html
[28 Mar 2006 11:26]
Jeppe Skovbon
That works. Thank you :-)
[28 Mar 2006 15:07]
Tonci Grgin
No problem.
[11 May 2010 0:10]
Chandni Verma
I had a similar problem. Resolved! Thanks!