The following error occurs when 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: cocould 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 acceptable. All charsets in my database and data table are set to utf8.
I have no problem with the program in Windows xp, but in Linux, errors are reported for the same program and database.
There are a lot of questions about this issue found on the Internet, of course, it is basically an insert into error, basically it is recommended to set names gbk, or delete the database and recreate.
However, this is not the reason for my situation. After careful consideration, My SQL statement executes the stored procedure, and whether the stored procedure should have character sets like the table,
The character set of stored procedure parameters should also be set.Copy codeThe Code is as follows: create definer = 'root' @ 'localhost' PROCEDURE 'ceapet _ upload_proce '(IN userId varchar (30), IN dir varchar (30), IN search varchar (30) charset utf8)
The problem is solved in this way!