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!