mysql插入报错:java.sql.SQLException: Incorrect string value: '\xE6\x9D\xAD\xE5\xB7\x9E...' for column 'address' at row 1
界面报错:
日志报错:
java.sql.SQLException: Incorrect string value: '\xE6\x9D\xAD\xE5\xB7\x9E...' for column 'address' at row
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:) ~[mysql-connector-java-8.0..jar:8.0.]
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:) ~[mysql-connector-java-8.0..jar:8.0.]
at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:) ~[mysql-connector-java-8.0..jar:8.0.]
at com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:) ~[mysql-connector-java-8.0..jar:8.0.]
at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdateInternal(ClientPreparedStatement.java:) ~[mysql-connector-java-8.0..jar:8.0.]
at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdateInternal(ClientPreparedStatement.java:) ~[mysql-connector-java-8.0..jar:8.0.]
at com.mysql.cj.jdbc.ClientPreparedStatement.executeLargeUpdate(ClientPreparedStatement.java:) ~[mysql-connector-java-8.0..jar:8.0.]
at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdate(ClientPreparedStatement.java:) ~[mysql-connector-java-8.0..jar:8.0.]
at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeUpdate(ProxyPreparedStatement.java:) ~[HikariCP-3.2..jar:na]
at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeUpdate(HikariProxyPreparedStatement.java) ~[HikariCP-3.2..jar:na]
at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:) ~[hibernate-core-5.3..Final.jar:5.3..Final]
at org.hibernate.dialect.identity.GetGeneratedKeysDelegate.executeAndExtract(GetGeneratedKeysDelegate.java:) ~[hibernate-core-5.3..Final.jar:5.3..Final]
at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:) ~[hibernate-core-5.3..Final.jar:5.3..Final]
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:) ~[hibernate-core-5.3..Final.jar:5.3..Final]
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:) ~[hibernate-core-5.3..Final.jar:5.3..Final]
at org.hibernate.action.internal.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:) ~[hibernate-core-5.3..Final.jar:5.3..Final]
at org.hibernate.engine.spi.ActionQueue.execute(ActionQueue.java:) ~[hibernate-core-5.3..Final.jar:5.3..Final]
at org.hibernate.engine.spi.ActionQueue.addResolvedEntityInsertAction(ActionQueue.java:) ~[hibernate-core-5.3..Final.jar:5.3..Final]
at org.hibernate.engine.spi.ActionQueue.addInsertAction(ActionQueue.java:) ~[hibernate-core-5.3..Final.jar:5.3..Final]
at org.hibernate.engine.spi.ActionQueue.addAction(ActionQueue.java:) ~[hibernate-core-5.3..Final.jar:5.3..Final]
at org.hibernate.event.internal.AbstractSaveEventListener.addInsertAction(AbstractSaveEventListener.java:) ~[hibernate-core-5.3..Final.jar:5.3..Final]
at org.hibernate.event.internal.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:) ~[hibernate-core-5.3..Final.jar:5.3..Final]
at org.hibernate.event.internal.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:) ~[hibernate-core-5.3..Final.jar:5.3..Final]
at org.hibernate.event.internal.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:) ~[hibernate-core-5.3..Final.jar:5.3..Final]
at org.hibernate.event.internal.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:) ~[hibernate-core-5.3..Final.jar:5.3..Final]
at org.hibernate.event.internal.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:) ~[hibernate-core-5.3..Final.jar:5.3..Final]
at org.hibernate.event.internal.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:) ~[hibernate-core-5.3..Final.jar:5.3..Final]
at org.hibernate.internal.SessionImpl.firePersist(SessionImpl.java:) ~[hibernate-core-5.3..Final.jar:5.3..Final]
at org.hibernate.internal.SessionImpl.persist(SessionImpl.java:) ~[hibernate-core-5.3..Final.jar:5.3..Final]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_102]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:) ~[na:1.8.0_102]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:) ~[na:1.8.0_102]
at java.lang.reflect.Method.invoke(Method.java:) ~[na:1.8.0_102]
at org.springframework.orm.jpa.ExtendedEntityManagerCreator$ExtendedEntityManagerInvocationHandler.invoke(ExtendedEntityManagerCreator.java:) ~[spring-orm-5.1..RELEASE.jar:5.1..RELEASE]
at com.sun.proxy.$Proxy82.persist(Unknown Source) ~[na:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_102]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:) ~[na:1.8.0_102]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:) ~[na:1.8.0_102]
at java.lang.reflect.Method.invoke(Method.java:) ~[na:1.8.0_102]
at org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:) ~[spring-orm-5.1..RELEASE.jar:5.1..RELEASE]
at com.sun.proxy.$Proxy82.persist(Unknown Source) ~[na:na]
at org.springframework.data.jpa.repository.support.SimpleJpaRepository.save(SimpleJpaRepository.java:) ~[spring-data-jpa-2.1..RELEASE.jar:2.1..RELEASE]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_102]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:) ~[na:1.8.0_102]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:) ~[na:1.8.0_102]
at java.lang.reflect.Method.invoke(Method.java:) ~[na:1.8.0_102]
at org.springframework.data.repository.core.support.RepositoryComposition$RepositoryFragments.invoke(RepositoryComposition.java:) ~[spring-data-commons-2.1..RELEASE.jar:2.1..RELEASE]
at org.springframework.data.repository.core.support.RepositoryComposition.invoke(RepositoryComposition.java:) ~[spring-data-commons-2.1..RELEASE.jar:2.1..RELEASE]
at org.springframework.data.repository.core.support.RepositoryFactorySupport$ImplementationMethodExecutionInterceptor.invoke(RepositoryFactorySupport.java:) ~[spring-data-commons-2.1..RELEASE.jar:2.1..RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:) ~[spring-aop-5.1..RELEASE.jar:5.1..RELEASE]
at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.doInvoke(RepositoryFactorySupport.java:) ~[spring-data-commons-2.1..RELEASE.jar:2.1..RELEASE]
at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.lambda$invoke$(RepositoryFactorySupport.java:) ~[spring-data-commons-2.1..RELEASE.jar:2.1..RELEASE]
at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:) ~[spring-data-commons-2.1..RELEASE.jar:2.1..RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:) ~[spring-aop-5.1..RELEASE.jar:5.1..RELEASE]
at org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.invoke(DefaultMethodInvokingMethodInterceptor.java:) ~[spring-data-commons-2.1..RELEASE.jar:2.1..RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:) ~[spring-aop-5.1..RELEASE.jar:5.1..RELEASE]
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:) ~[spring-tx-5.1..RELEASE.jar:5.1..RELEASE]
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:) ~[spring-tx-5.1..RELEASE.jar:5.1..RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:) ~[spring-aop-5.1..RELEASE.jar:5.1..RELEASE]
at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:) ~[spring-tx-5.1..RELEASE.jar:5.1..RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:) ~[spring-aop-5.1..RELEASE.jar:5.1..RELEASE]
at org.springframework.data.jpa.repository.support.CrudMethodMetadataPostProcessor$CrudMethodMetadataPopulatingMethodInterceptor.invoke(CrudMethodMetadataPostProcessor.java:) ~[spring-data-jpa-2.1..RELEASE.jar:2.1..RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:) ~[spring-aop-5.1..RELEASE.jar:5.1..RELEASE]
at org.springframework.data.jpa.repository.support.CrudMethodMetadataPostProcessor$ExposeRepositoryInvocationInterceptor.invoke(CrudMethodMetadataPostProcessor.java:) ~[spring-data-jpa-2.1..RELEASE.jar:2.1..RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:) ~[spring-aop-5.1..RELEASE.jar:5.1..RELEASE]
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:) ~[spring-aop-5.1..RELEASE.jar:5.1..RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:) ~[spring-aop-5.1..RELEASE.jar:5.1..RELEASE]
at org.springframework.data.repository.core.support.SurroundingTransactionDetectorMethodInterceptor.invoke(SurroundingTransactionDetectorMethodInterceptor.java:) ~[spring-data-commons-2.1..RELEASE.jar:2.1..RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:) ~[spring-aop-5.1..RELEASE.jar:5.1..RELEASE]
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:) ~[spring-aop-5.1..RELEASE.jar:5.1..RELEASE]
at com.sun.proxy.$Proxy84.save(Unknown Source) ~[na:na]
at com.wlf.order.prize.service.OrderService.insertOrders(OrderService.java:) ~[classes/:na]
at com.wlf.order.prize.control.OrderController.syncronizeOrders(OrderController.java:) ~[classes/:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_102]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:) ~[na:1.8.0_102]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:) ~[na:1.8.0_102]
at java.lang.reflect.Method.invoke(Method.java:) ~[na:1.8.0_102]
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:) ~[spring-web-5.1..RELEASE.jar:5.1..RELEASE]
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:) ~[spring-web-5.1..RELEASE.jar:5.1..RELEASE]
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:) ~[spring-webmvc-5.1..RELEASE.jar:5.1..RELEASE]
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:) ~[spring-webmvc-5.1..RELEASE.jar:5.1..RELEASE]
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:) ~[spring-webmvc-5.1..RELEASE.jar:5.1..RELEASE]
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:) ~[spring-webmvc-5.1..RELEASE.jar:5.1..RELEASE]
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:) ~[spring-webmvc-5.1..RELEASE.jar:5.1..RELEASE]
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:) ~[spring-webmvc-5.1..RELEASE.jar:5.1..RELEASE]
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:) ~[spring-webmvc-5.1..RELEASE.jar:5.1..RELEASE]
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:) ~[spring-webmvc-5.1..RELEASE.jar:5.1..RELEASE]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:) ~[tomcat-embed-core-9.0..jar:9.0.]
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:) ~[spring-webmvc-5.1..RELEASE.jar:5.1..RELEASE]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:) ~[tomcat-embed-core-9.0..jar:9.0.]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:) ~[tomcat-embed-core-9.0..jar:9.0.]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:) ~[tomcat-embed-core-9.0..jar:9.0.]
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:) ~[tomcat-embed-websocket-9.0..jar:9.0.]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:) ~[tomcat-embed-core-9.0..jar:9.0.]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:) ~[tomcat-embed-core-9.0..jar:9.0.]
at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:) ~[spring-web-5.1..RELEASE.jar:5.1..RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:) ~[spring-web-5.1..RELEASE.jar:5.1..RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:) ~[tomcat-embed-core-9.0..jar:9.0.]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:) ~[tomcat-embed-core-9.0..jar:9.0.]
at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:) ~[spring-web-5.1..RELEASE.jar:5.1..RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:) ~[spring-web-5.1..RELEASE.jar:5.1..RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:) ~[tomcat-embed-core-9.0..jar:9.0.]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:) ~[tomcat-embed-core-9.0..jar:9.0.]
at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:) ~[spring-web-5.1..RELEASE.jar:5.1..RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:) ~[spring-web-5.1..RELEASE.jar:5.1..RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:) ~[tomcat-embed-core-9.0..jar:9.0.]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:) ~[tomcat-embed-core-9.0..jar:9.0.]
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:) ~[spring-web-5.1..RELEASE.jar:5.1..RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:) ~[spring-web-5.1..RELEASE.jar:5.1..RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:) ~[tomcat-embed-core-9.0..jar:9.0.]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:) ~[tomcat-embed-core-9.0..jar:9.0.]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:) ~[tomcat-embed-core-9.0..jar:9.0.]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:) [tomcat-embed-core-9.0..jar:9.0.]
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:) [tomcat-embed-core-9.0..jar:9.0.]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:) [tomcat-embed-core-9.0..jar:9.0.]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:) [tomcat-embed-core-9.0..jar:9.0.]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:) [tomcat-embed-core-9.0..jar:9.0.]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:) [tomcat-embed-core-9.0..jar:9.0.]
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:) [tomcat-embed-core-9.0..jar:9.0.]
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:) [tomcat-embed-core-9.0..jar:9.0.]
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:) [tomcat-embed-core-9.0..jar:9.0.]
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:) [tomcat-embed-core-9.0..jar:9.0.]
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:) [tomcat-embed-core-9.0..jar:9.0.]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:) [na:1.8.0_102]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:) [na:1.8.0_102]
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:) [tomcat-embed-core-9.0..jar:9.0.]
at java.lang.Thread.run(Thread.java:) [na:1.8.0_102]
很明显,入库时address字段为中文,mysql数据库不支持,它默认支持的是ISO-8859-1,别名latin1。可以看到数据库、表,都是这种默认编码格式:
mysql> show create database test;
+----------+-----------------------------------------------------------------+
| Database | Create Database |
+----------+-----------------------------------------------------------------+
| test | CREATE DATABASE `test` /*!40100 DEFAULT CHARACTER SET latin1 */ |
+----------+-----------------------------------------------------------------+
row in set (0.00 sec)
mysql> show create table test.t_order;
+---------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+---------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| t_order | CREATE TABLE `t_order` (
`id` bigint() NOT NULL AUTO_INCREMENT,
`access_channel` varchar() DEFAULT NULL,
`address` varchar() DEFAULT NULL,
`area` varchar() DEFAULT NULL,
`channel` varchar() DEFAULT NULL,
`linkphone` varchar() DEFAULT NULL,
`name` varchar() DEFAULT NULL,
`oprcode` varchar() DEFAULT NULL,
`oprtime` varchar() DEFAULT NULL,
`order_id` varchar() NOT NULL,
`servernum` varchar() DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 |
+---------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
row in set (0.00 sec)
我们只需要把ISO-8859-1改为UTF-8即可:
mysql> alter database test default character set utf8;
Query OK, row affected (0.01 sec) mysql> show create database test;
+----------+---------------------------------------------------------------+
| Database | Create Database |
+----------+---------------------------------------------------------------+
| test | CREATE DATABASE `test` /*!40100 DEFAULT CHARACTER SET utf8 */ |
+----------+---------------------------------------------------------------+
row in set (0.00 sec) mysql> alter table test.t_order convert to character set utf8 collate utf8_general_ci;
Query OK, rows affected (0.05 sec)
Records: Duplicates: Warnings: mysql> show create table test.t_order;
+---------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+---------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| t_order | CREATE TABLE `t_order` (
`id` bigint() NOT NULL AUTO_INCREMENT,
`access_channel` varchar() DEFAULT NULL,
`address` varchar() DEFAULT NULL,
`area` varchar() DEFAULT NULL,
`channel` varchar() DEFAULT NULL,
`linkphone` varchar() DEFAULT NULL,
`name` varchar() DEFAULT NULL,
`oprcode` varchar() DEFAULT NULL,
`oprtime` varchar() DEFAULT NULL,
`order_id` varchar() NOT NULL,
`servernum` varchar() DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 |
+---------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
row in set (0.00 sec)
再跑一次接口,ok,中文地址入库了:
数据库:
mysql插入报错:java.sql.SQLException: Incorrect string value: '\xE6\x9D\xAD\xE5\xB7\x9E...' for column 'address' at row 1的更多相关文章
- jeesite导入数据库错误:java.sql.SQLException: Incorrect string value: '\xE4\xB8\xAD\xE5\x9B\xBD' for column 'name' at row 1问题解决
如果使用mvn antrun:run -Pinit-db进行数据库导入导致出现如下错误: 解决方法: 这个是由于新建数据库没有选择默认字符集导致的,只要选择utf-8即可.
- Mysql插入数据报错java.sql.SQLException: Incorrect string value: '\xF0\x9F\x93\x8D\xE6\x88...'
今天读取solr里面的数据,往mysql插入时报错, Incorrect string value: '\xF0\x9F\x93\x8D\xE8\x88...' for column 'title' ...
- java.sql.SQLException: Incorrect string value: '\xE6\x88\x91\xE7\x9A\x84...' for column 'groupName'
java.sql.SQLException: Incorrect string value: '\xE6\x88\x91\xE7\x9A\x84...' for column 'groupName' ...
- MySQL报错:Cause: java.sql.SQLException: Incorrect string value: '\xE6\x9D\xA8","...' for column 'obj_value' at row 1
1.插入MySQL表时,报错:Cause: java.sql.SQLException: Incorrect string value: '\xE6\x9D\xA8","...' ...
- java.sql.SQLException: Incorrect string value: '\xF0\x9F\x9A\x80\xF0\x9F...' for column 'name' at row 1
1.异常提示: 12:59:10.000 [http-nio-8080-exec-40] DEBUG o.s.j.s.SQLStateSQLExceptionTranslator - Extracte ...
- nested exception is java.sql.SQLException: Incorrect string value: '\xE7\x99\xBB\xE9\x99\x86...' for column 'image' at row 1
HTTP Status 500 - Hibernate operation: could not insert: [cn.itcast.shop.product.vo.Product]; uncate ...
- ERROR 1366 (HY000): Incorrect string value: '\xE9\x83\x91\xE5\xB7\x9E' for column 'aa' at row 1 MySQL 字符集
ERROR 1366 (HY000): Incorrect string value: '\xE9\x83\x91\xE5\xB7\x9E' for column 'aa' at row 1创建表之后 ...
- 解决java.sql.SQLException: Incorrect string value: '\xE6\x88\x91\xE7\x9A\x84...' for column 'groupName'
今天使用mysql,用java程序往mysql中写数据,出现如下错误: Caused by: java.sql.SQLException: Incorrect string value: '\xD3\ ...
- mysql 保存emoji时报,数据库报错:Caused by: java.sql.SQLException: Incorrect string value: '\xF0\x9F\x98\x82\xF0\x9F...' for column 'review' at row 1
错误原因:我们可以看到错误提示中的字符0xF0 0x9F 0x98 0x84 ,这对应UTF-8编码格式中的4字节编码(UTF-8编码规范).正常的汉字一般不会超过3个字节,为什么为出现4个字节呢?实 ...
随机推荐
- package的xml格式的改变
package.xml文件格式由1到2发生了一些变化: 格式2有如下一行: <package format="2"> 依赖也发生一些变化<depend> 格 ...
- P2220 [HAOI2012]容易题[小学数学]
题目描述 为了使得大家高兴,小Q特意出个自认为的简单题(easy)来满足大家,这道简单题是描述如下: 有一个数列A已知对于所有的A[i]都是1~n的自然数,并且知道对于一些A[i]不能取哪些值,我们定 ...
- 关于Python文件读写
Python中文件操作可以通过open函数,这的确很像C语言中的fopen.通过open函数获取一个file object,然后调用read(),write()等方法对文件进行读写操作. 1.open ...
- signed Unsigned Compare
// signUnsignCompare.cpp : Defines the entry point for the console application. // #include "st ...
- 一个项目管理Master的心声
毕业第二年我被幸运女神所眷顾,一下成为了一个20多人研发团队的项目master,自己还未从职场菜鸟的称呼中走出来,就要开始管理团队,在接到通知的时候心里既兴奋又慌得六神无主,然而奔着初生牛犊不怕虎的精 ...
- VisualStudio中集成扩展调试SOS
SOS扩展也是可以和VisualStudio进行集成的,这样真的方便了我们调试一些性能要求比较高的程序,当程序运行一段时间后我们用VS附加到进程,然后查看一些重要的对象数据,但是此时我们看不到.NET ...
- 2.学习SpringMVC注解入门篇
一.SpringMVC执行流程 . 二.创建项目学习SpringMVC注解 按照我之前的SpringMVC创建项目,首先创建一个项目springmvc01,配置好pom.xml,web.xml,spr ...
- 2019.10.1 qbxt模拟题
第一题 考虑树上\(DP\),f[i][j][0/1]表示以\(i\)为根的子树,入读为零点的个数为\(j\),点\(i\)的入度为\(0\)/不为\(0\)时的方案数 转移的时候考虑\(u\)的一个 ...
- mac 安装注册Charles
软件去官网下载安装即可. 下载地址:https://www.charlesproxy.com/download/ 适用于Charles任意版本的注册码Charles 4.2.7 目前是最新版,可用. ...
- 使用apt-mirror搭建debian镜像源
debian官方提供了脚本ftpsync来搭建源镜像,而 apt-mirror 是一个更简单便捷的源镜像搭建工具. 安装 apt-mirror sudo apt-get install apt-mir ...