MYSQL error Incorrect string value for Column_mysql

Source: Internet
Author: User
Tags sql error
The following error occurred using JavaBean.

66480555 [http-80-4] WARN org.hibernate.util.jdbcexceptionreporter-sql error:1366, sqlstate:hy000
66480555 [http-80-4] ERROR org.hibernate.util.jdbcexceptionreporter-incorrect string value: ' \xe7\x89\xa9\xe8\xb5\ x84. ' For column ' Search ' at row 1
Org.hibernate.exception.GenericJDBCException:could not execute Query
At Org.hibernate.exception.SQLStateConverter.handledNonSpecificException (sqlstateconverter.java:103)
At Org.hibernate.exception.SQLStateConverter.convert (sqlstateconverter.java:91)
At Org.hibernate.exception.JDBCExceptionHelper.convert (jdbcexceptionhelper.java:43)
At Org.hibernate.loader.Loader.doList (loader.java:2208)
At Org.hibernate.loader.Loader.listIgnoreQueryCache (loader.java:2102)
At Org.hibernate.loader.Loader.list (loader.java:2097)
At Org.hibernate.loader.custom.CustomLoader.list (customloader.java:289)
At Org.hibernate.impl.SessionImpl.listCustomQuery (sessionimpl.java:1699)
At Org.hibernate.impl.AbstractSessionImpl.list (abstractsessionimpl.java:142)
At Org.hibernate.impl.SQLQueryImpl.list (sqlqueryimpl.java:152)
At Ceapet.jbpm.fileUploadBean.mRecordsList (fileuploadbean.java:313)

Java.sql.SQLException:Incorrect string value: ' \xe4\xba\x8c\xe6\xac\xa1 ... ' for column ' Search ' at row 1

You cannot search in Chinese, but insert into Chinese is OK. All the charset in my database and datasheet are set UTF8.
I have no problem with the program under Windows XP, but under Linux, the same program, the same database on the error, baffled.

Search on the internet there are a lot of questions about this, of course, the basic is insert into the error, the basic is recommended set names GBK, or delete the database to the new.

But for my specific situation, this should not be the reason. After careful consideration, my SQL execution is stored procedure, is not stored procedures should be the same as table with the problem of character set, sure enough,
The character set of the parameters of the stored procedure should also be set.
Copy Code code as follows:

CREATE definer= ' root ' @ ' localhost ' PROCEDURE ' ceapet_upload_proce ' (in userId varchar (a), in dir varchar (d), in search varchar () CharSet UTF8)

That's how the problem is solved!
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.