Exception in thread & quot; main & quot; java. SQL... Solution

Source: Internet
Author: User

Exception in thread "main" java. SQL .. A java + mysql program has been written on the local machine, but when it is transplanted to other machines, an error is always reported when the database is inserted, as shown in [java] Exception in thread "main" java. SQL. SQLException: Incorrect string value: '\ xF0 \ xA2 \ x9C \ xB6 \ xE2 \ x80... 'for column 'value' at row 1 at com. mysql. jdbc. mysqlIO. checkErrorPacket (MysqlIO. java: 2975) at com. mysql. jdbc. mysqlIO. sendCommand (MysqlIO. java: 1600) .... the reason is as follows: In Eclipse, the encoding is GBK. When configuring Mysql on the local machine, the encoding is GBK. However, when encoding is configured for mysql on the target computer, latin1 or utf8 is selected, leading to the above error. Solution: Enter MySQL Server Instance Configuration and change mysql character encoding to GBK! This error occurs because the character encoding in mysql is different from that in the program.

Related Article

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.