Insert database java. SQL. sqlexception: incorrect string value: '\ xe6 \ xa3 \ xb0 \ xe6 \ xbf \ x8b... '

Source: Internet
Author: User


Recently, I used an XML file to send a stream file to insert it into the database. It took a long time to locate the bug because of intermediate encryption, transcoding, and a bunch of operations, the final reason is that the table creation brothers do not know how to do this. Some fields are followed by character set definitions.

Character Set Latin1

As a result

Java. SQL. sqlexception: incorrect string value: '\ xe6 \ xa3 \ xb0 \ xe6 \ xbf \ x8b... 'For column' songname' at Row 1 query: insert into 'x52 _ homeland_s1 '. 'musicinfo' ('mode2', 'modes ', 'mode1', 'duration', 'bpm', 'levelinfoid', 'songi', 'songname', 'oggi ', 'singer', 'alipay', 'status', 'updatetime', 'createtime', 'tags') values ('0', '64; ', '0 ', '123', '123', '123', '123', 'hangzhou Hangzhou (Hangzhou) ', '123', 'hangzhou becomes a hangzhou ','', '0', '2017-01-01 08:00:01. 0', '2017-01-01 08:00:01. 0', '2017; 105; 201; 301; 401; ') parameters: [] At Org. apache. commons. dbutils. abstractqueryrunner. rethrow (abstractqueryrunner. java: 320) at Org. apache. commons. dbutils. queryrunner. update (queryrunner. java: 489) at Org. apache. commons. dbutils. queryrunner. update (queryrunner. java: 419) at framework. DB. dbmanager. insert (dbmanager. java: 209) at service. impl. idipserviceimpl. musicadd (idipserviceimpl. java: 2155) at framework.net. idipresponser. messagereceived (idipresponser. java: 684) at Org. apache. mina. core. filterchain. defaultiofilterchain $ tailfilter. messagereceived (defaultiofilterchain. java: 716) at Org. apache. mina. core. filterchain. defaultiofilterchain. callnextmessagereceived (defaultiofilterchain. java: 434) at Org. apache. mina. core. filterchain. defaultiofilterchain. accesskey $1200 (defaultiofilterchain. java: 46) at Org. apache. mina. core. filterchain. defaultiofilterchain $ entryimpl $1. messagereceived (defaultiofilterchain. java: 796) at Org. apache. mina. core. filterchain. iofilterevent. fire (iofilterevent. java: 75) at Org. apache. mina. core. session. ioevent. run (ioevent. java: 63) at org.apache.mina.filter.exe cutor. orderedthreadpoolexecutor $ worker. runtask (orderedthreadpoolexecutor. java: 780) at org.apache.mina.filter.exe cutor. orderedthreadpoolexecutor $ worker. runtasks (orderedthreadpoolexecutor. java: 772) at org.apache.mina.filter.exe cutor. orderedthreadpoolexecutor $ worker. run (orderedthreadpoolexecutor. java: 714) at java. lang. thread. run (thread. java: 662)

the solution is to delete and recreate the table.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.