解决办法:
ALTER TABLE RYAN.SYS_VISIT_LOG CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
异常原因:
org.springframework.jdbc.UncategorizedSQLException:
### Error updating database. Cause: java.sql.SQLException: Incorrect string value: '\xE8\xBF\x9B\xE5\x85\xA5...' for column 'USE_FUNC' at row 1
### The error may involve org.ryan.demo.dao.SysVisitLogMapper.insert-Inline
### The error occurred while setting parameters
### SQL: insert into SYS_VISIT_LOG (VISIST_LOG_ID, IP_ADDR, URI, URL, USE_FUNC, USER_AGENT, EQUIPMENT, AREA_CODE, MAC, USER_ID, CREATE_AT) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
### Cause: java.sql.SQLException: Incorrect string value: '\xE8\xBF\x9B\xE5\x85\xA5...' for column 'USE_FUNC' at row 1
; uncategorized SQLException for SQL []; SQL state [HY000]; error code [1366]; Incorrect string value: '\xE8\xBF\x9B\xE5\x85\xA5...' for column 'USE_FUNC' at row 1; nested exception is java.sql.SQLException: Incorrect string value: '\xE8\xBF\x9B\xE5\x85\xA5...' for column 'USE_FUNC' at row 1
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:90)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:82)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:82)
at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:73)
at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:446)
at com.sun.proxy.$Proxy97.insert(Unknown Source)
at org.mybatis.spring.SqlSessionTemplate.insert(SqlSessionTemplate.java:278)
at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:58)
at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:59)
at com.sun.proxy.$Proxy98.insert(Unknown Source)
at org.ryan.demo.config.aspet.LogAspet.before(LogAspet.java:88)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
网友评论