简体   繁体   中英

MySQL JDBC connector string truncation

When accessing MySQL through JDBC, the following exception was thrown from the jdbc connector (5.1.39).

Value '\48$2ef8cd3c-e4d7-4ad5-8d60-504f6e7db07a\2016-11-21 17:26:37\2016-11-21 17:26:37\ABCDEFGH\\n2016-08-01\\n2016-08-16\SOMETHING\2\1481\1\2016\\b50016387\ 01026940427\company XYZ???\2$17b9f783-a7c2-4d49-bbc1-8ad73479a0b6\2016-11-13 13:31:26\2016-11-21 17:44:00\1\1481\XXXXXXXXXXX\ companya\ 00662850544\abcd@email.com\\bregular\48$57eff2d9-35e0-415a-81e4-04797192133f\2016-11-13 13:35:35\2016-11-22 14:40:03\2361.93\48\EUR\1\\bSTATUS?\\n2016-12-31\\n2017-03-09?\1\83\5828d21111000070071715f2\48\ 0.001937241\ 0.037620570\ 0.120000000\ 0.052392000\ 1.000000000\0\0\0\0\0\ 0.037620570\ 0.001414463\ 0.004799110\1\2\1\48\348.743925612\\f19.186074388\ 0.012392000\ 0.001574005\ 0.004008749\0\\0000-00-00 00:00:00\0000-00-00 00:00:00\0\\u0\u003c/i> 000\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' can not be represented as java.sql.Timestamp

This looks like the JDBC driver cannot correctly determine the end of strings in the result row. Our table are in latin1.

Is there anything that should be done on the connection level to prevents these issues?

The issue was solved upgrading from 5.7.11 a 5.7.26. Lesson learned: do not underestimate the importance of minor releases

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM