Failure to save emoji by sql in mybatis mapper












-1















mysql version: 5.7.20



mysql-connector-java: 5.1.37



encoding: utf-8 unicode(utf8mb4)



sql in mapper:



    <insert id="insert" parameterType="cc.xx.xx.entity.PersonInfo" useGeneratedKeys="true" keyProperty="id" >
insert into person_info ( name, age)
values (
#{name,jdbcType=VARCHAR},
#{age,jdbcType=INTEGER}
)
</insert>


question:



save data to mysql failure when name contain emoji, but removed jdbcType try agin, it save successfully.



name like this:
"🍀name🐶name🐶"



exception:



Caused by: java.sql.SQLException: Incorrect string value: 'xF0x9Fx90xB6xF0x9F...' for column 'objectDescription' at row 1
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:959) ~[mysql-connector-java-5.1.37.jar:5.1.37]
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3870) ~[mysql-connector-java-5.1.37.jar:5.1.37]
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3806) ~[mysql-connector-java-5.1.37.jar:5.1.37]
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2470) ~[mysql-connector-java-5.1.37.jar:5.1.37]
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2617) ~[mysql-connector-java-5.1.37.jar:5.1.37]
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2550) ~[mysql-connector-java-5.1.37.jar:5.1.37]
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1861) ~[mysql-connector-java-5.1.37.jar:5.1.37]
at com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:1192) ~[mysql-connector-java-5.1.37.jar:5.1.37]
at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_execute(FilterChainImpl.java:3051) ~[druid-1.1.6.jar:1.1.6]
at com.alibaba.druid.filter.FilterEventAdapter.preparedStatement_execute(FilterEventAdapter.java:440) ~[druid-1.1.6.jar:1.1.6]
at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_execute(FilterChainImpl.java:3049) ~[druid-1.1.6.jar:1.1.6]
at com.alibaba.druid.wall.WallFilter.preparedStatement_execute(WallFilter.java:619) ~[druid-1.1.6.jar:1.1.6]
at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_execute(FilterChainImpl.java:3049) ~[druid-1.1.6.jar:1.1.6]
at com.alibaba.druid.filter.FilterEventAdapter.preparedStatement_execute(FilterEventAdapter.java:440) ~[druid-1.1.6.jar:1.1.6]
at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_execute(FilterChainImpl.java:3049) ~[druid-1.1.6.jar:1.1.6]
at com.alibaba.druid.proxy.jdbc.PreparedStatementProxyImpl.execute(PreparedStatementProxyImpl.java:167) ~[druid-1.1.6.jar:1.1.6]
at com.alibaba.druid.pool.DruidPooledPreparedStatement.execute(DruidPooledPreparedStatement.java:498) ~[druid-1.1.6.jar:1.1.6]
at org.apache.ibatis.executor.statement.PreparedStatementHandler.update(PreparedStatementHandler.java:46) ~[mybatis-3.4.6.jar:3.4.6]
at org.apache.ibatis.executor.statement.RoutingStatementHandler.update(RoutingStatementHandler.java:74) ~[mybatis-3.4.6.jar:3.4.6]
at org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:50) ~[mybatis-3.4.6.jar:3.4.6]
at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:117) ~[mybatis-3.4.6.jar:3.4.6]
at org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:76) ~[mybatis-3.4.6.jar:3.4.6]
at sun.reflect.GeneratedMethodAccessor176.invoke(Unknown Source) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_112]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_112]
at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:63) ~[mybatis-3.4.6.jar:3.4.6]
at com.sun.proxy.$Proxy95.update(Unknown Source) ~[?:?]
at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:198) ~[mybatis-3.4.6.jar:3.4.6]
at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:185) ~[mybatis-3.4.6.jar:3.4.6]
at sun.reflect.GeneratedMethodAccessor220.invoke(Unknown Source) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_112]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_112]










share|improve this question

























  • So you fixed the problem, what it the question?

    – Roman Konoval
    Oct 31 '18 at 9:27











  • I do not know why removed 'jdbcType' can be save success.

    – Vainlyh
    Nov 1 '18 at 7:21











  • In this case your question is incomplete. It lacks the error message that you get and the parameter that you pass to the query.

    – Roman Konoval
    Nov 1 '18 at 9:57











  • Thank you very much for your reply,I have added parameter and exception message.

    – Vainlyh
    Nov 1 '18 at 14:24
















-1















mysql version: 5.7.20



mysql-connector-java: 5.1.37



encoding: utf-8 unicode(utf8mb4)



sql in mapper:



    <insert id="insert" parameterType="cc.xx.xx.entity.PersonInfo" useGeneratedKeys="true" keyProperty="id" >
insert into person_info ( name, age)
values (
#{name,jdbcType=VARCHAR},
#{age,jdbcType=INTEGER}
)
</insert>


question:



save data to mysql failure when name contain emoji, but removed jdbcType try agin, it save successfully.



name like this:
"🍀name🐶name🐶"



exception:



Caused by: java.sql.SQLException: Incorrect string value: 'xF0x9Fx90xB6xF0x9F...' for column 'objectDescription' at row 1
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:959) ~[mysql-connector-java-5.1.37.jar:5.1.37]
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3870) ~[mysql-connector-java-5.1.37.jar:5.1.37]
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3806) ~[mysql-connector-java-5.1.37.jar:5.1.37]
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2470) ~[mysql-connector-java-5.1.37.jar:5.1.37]
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2617) ~[mysql-connector-java-5.1.37.jar:5.1.37]
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2550) ~[mysql-connector-java-5.1.37.jar:5.1.37]
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1861) ~[mysql-connector-java-5.1.37.jar:5.1.37]
at com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:1192) ~[mysql-connector-java-5.1.37.jar:5.1.37]
at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_execute(FilterChainImpl.java:3051) ~[druid-1.1.6.jar:1.1.6]
at com.alibaba.druid.filter.FilterEventAdapter.preparedStatement_execute(FilterEventAdapter.java:440) ~[druid-1.1.6.jar:1.1.6]
at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_execute(FilterChainImpl.java:3049) ~[druid-1.1.6.jar:1.1.6]
at com.alibaba.druid.wall.WallFilter.preparedStatement_execute(WallFilter.java:619) ~[druid-1.1.6.jar:1.1.6]
at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_execute(FilterChainImpl.java:3049) ~[druid-1.1.6.jar:1.1.6]
at com.alibaba.druid.filter.FilterEventAdapter.preparedStatement_execute(FilterEventAdapter.java:440) ~[druid-1.1.6.jar:1.1.6]
at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_execute(FilterChainImpl.java:3049) ~[druid-1.1.6.jar:1.1.6]
at com.alibaba.druid.proxy.jdbc.PreparedStatementProxyImpl.execute(PreparedStatementProxyImpl.java:167) ~[druid-1.1.6.jar:1.1.6]
at com.alibaba.druid.pool.DruidPooledPreparedStatement.execute(DruidPooledPreparedStatement.java:498) ~[druid-1.1.6.jar:1.1.6]
at org.apache.ibatis.executor.statement.PreparedStatementHandler.update(PreparedStatementHandler.java:46) ~[mybatis-3.4.6.jar:3.4.6]
at org.apache.ibatis.executor.statement.RoutingStatementHandler.update(RoutingStatementHandler.java:74) ~[mybatis-3.4.6.jar:3.4.6]
at org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:50) ~[mybatis-3.4.6.jar:3.4.6]
at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:117) ~[mybatis-3.4.6.jar:3.4.6]
at org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:76) ~[mybatis-3.4.6.jar:3.4.6]
at sun.reflect.GeneratedMethodAccessor176.invoke(Unknown Source) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_112]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_112]
at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:63) ~[mybatis-3.4.6.jar:3.4.6]
at com.sun.proxy.$Proxy95.update(Unknown Source) ~[?:?]
at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:198) ~[mybatis-3.4.6.jar:3.4.6]
at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:185) ~[mybatis-3.4.6.jar:3.4.6]
at sun.reflect.GeneratedMethodAccessor220.invoke(Unknown Source) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_112]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_112]










share|improve this question

























  • So you fixed the problem, what it the question?

    – Roman Konoval
    Oct 31 '18 at 9:27











  • I do not know why removed 'jdbcType' can be save success.

    – Vainlyh
    Nov 1 '18 at 7:21











  • In this case your question is incomplete. It lacks the error message that you get and the parameter that you pass to the query.

    – Roman Konoval
    Nov 1 '18 at 9:57











  • Thank you very much for your reply,I have added parameter and exception message.

    – Vainlyh
    Nov 1 '18 at 14:24














-1












-1








-1








mysql version: 5.7.20



mysql-connector-java: 5.1.37



encoding: utf-8 unicode(utf8mb4)



sql in mapper:



    <insert id="insert" parameterType="cc.xx.xx.entity.PersonInfo" useGeneratedKeys="true" keyProperty="id" >
insert into person_info ( name, age)
values (
#{name,jdbcType=VARCHAR},
#{age,jdbcType=INTEGER}
)
</insert>


question:



save data to mysql failure when name contain emoji, but removed jdbcType try agin, it save successfully.



name like this:
"🍀name🐶name🐶"



exception:



Caused by: java.sql.SQLException: Incorrect string value: 'xF0x9Fx90xB6xF0x9F...' for column 'objectDescription' at row 1
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:959) ~[mysql-connector-java-5.1.37.jar:5.1.37]
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3870) ~[mysql-connector-java-5.1.37.jar:5.1.37]
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3806) ~[mysql-connector-java-5.1.37.jar:5.1.37]
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2470) ~[mysql-connector-java-5.1.37.jar:5.1.37]
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2617) ~[mysql-connector-java-5.1.37.jar:5.1.37]
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2550) ~[mysql-connector-java-5.1.37.jar:5.1.37]
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1861) ~[mysql-connector-java-5.1.37.jar:5.1.37]
at com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:1192) ~[mysql-connector-java-5.1.37.jar:5.1.37]
at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_execute(FilterChainImpl.java:3051) ~[druid-1.1.6.jar:1.1.6]
at com.alibaba.druid.filter.FilterEventAdapter.preparedStatement_execute(FilterEventAdapter.java:440) ~[druid-1.1.6.jar:1.1.6]
at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_execute(FilterChainImpl.java:3049) ~[druid-1.1.6.jar:1.1.6]
at com.alibaba.druid.wall.WallFilter.preparedStatement_execute(WallFilter.java:619) ~[druid-1.1.6.jar:1.1.6]
at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_execute(FilterChainImpl.java:3049) ~[druid-1.1.6.jar:1.1.6]
at com.alibaba.druid.filter.FilterEventAdapter.preparedStatement_execute(FilterEventAdapter.java:440) ~[druid-1.1.6.jar:1.1.6]
at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_execute(FilterChainImpl.java:3049) ~[druid-1.1.6.jar:1.1.6]
at com.alibaba.druid.proxy.jdbc.PreparedStatementProxyImpl.execute(PreparedStatementProxyImpl.java:167) ~[druid-1.1.6.jar:1.1.6]
at com.alibaba.druid.pool.DruidPooledPreparedStatement.execute(DruidPooledPreparedStatement.java:498) ~[druid-1.1.6.jar:1.1.6]
at org.apache.ibatis.executor.statement.PreparedStatementHandler.update(PreparedStatementHandler.java:46) ~[mybatis-3.4.6.jar:3.4.6]
at org.apache.ibatis.executor.statement.RoutingStatementHandler.update(RoutingStatementHandler.java:74) ~[mybatis-3.4.6.jar:3.4.6]
at org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:50) ~[mybatis-3.4.6.jar:3.4.6]
at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:117) ~[mybatis-3.4.6.jar:3.4.6]
at org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:76) ~[mybatis-3.4.6.jar:3.4.6]
at sun.reflect.GeneratedMethodAccessor176.invoke(Unknown Source) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_112]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_112]
at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:63) ~[mybatis-3.4.6.jar:3.4.6]
at com.sun.proxy.$Proxy95.update(Unknown Source) ~[?:?]
at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:198) ~[mybatis-3.4.6.jar:3.4.6]
at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:185) ~[mybatis-3.4.6.jar:3.4.6]
at sun.reflect.GeneratedMethodAccessor220.invoke(Unknown Source) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_112]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_112]










share|improve this question
















mysql version: 5.7.20



mysql-connector-java: 5.1.37



encoding: utf-8 unicode(utf8mb4)



sql in mapper:



    <insert id="insert" parameterType="cc.xx.xx.entity.PersonInfo" useGeneratedKeys="true" keyProperty="id" >
insert into person_info ( name, age)
values (
#{name,jdbcType=VARCHAR},
#{age,jdbcType=INTEGER}
)
</insert>


question:



save data to mysql failure when name contain emoji, but removed jdbcType try agin, it save successfully.



name like this:
"🍀name🐶name🐶"



exception:



Caused by: java.sql.SQLException: Incorrect string value: 'xF0x9Fx90xB6xF0x9F...' for column 'objectDescription' at row 1
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:959) ~[mysql-connector-java-5.1.37.jar:5.1.37]
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3870) ~[mysql-connector-java-5.1.37.jar:5.1.37]
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3806) ~[mysql-connector-java-5.1.37.jar:5.1.37]
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2470) ~[mysql-connector-java-5.1.37.jar:5.1.37]
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2617) ~[mysql-connector-java-5.1.37.jar:5.1.37]
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2550) ~[mysql-connector-java-5.1.37.jar:5.1.37]
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1861) ~[mysql-connector-java-5.1.37.jar:5.1.37]
at com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:1192) ~[mysql-connector-java-5.1.37.jar:5.1.37]
at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_execute(FilterChainImpl.java:3051) ~[druid-1.1.6.jar:1.1.6]
at com.alibaba.druid.filter.FilterEventAdapter.preparedStatement_execute(FilterEventAdapter.java:440) ~[druid-1.1.6.jar:1.1.6]
at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_execute(FilterChainImpl.java:3049) ~[druid-1.1.6.jar:1.1.6]
at com.alibaba.druid.wall.WallFilter.preparedStatement_execute(WallFilter.java:619) ~[druid-1.1.6.jar:1.1.6]
at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_execute(FilterChainImpl.java:3049) ~[druid-1.1.6.jar:1.1.6]
at com.alibaba.druid.filter.FilterEventAdapter.preparedStatement_execute(FilterEventAdapter.java:440) ~[druid-1.1.6.jar:1.1.6]
at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_execute(FilterChainImpl.java:3049) ~[druid-1.1.6.jar:1.1.6]
at com.alibaba.druid.proxy.jdbc.PreparedStatementProxyImpl.execute(PreparedStatementProxyImpl.java:167) ~[druid-1.1.6.jar:1.1.6]
at com.alibaba.druid.pool.DruidPooledPreparedStatement.execute(DruidPooledPreparedStatement.java:498) ~[druid-1.1.6.jar:1.1.6]
at org.apache.ibatis.executor.statement.PreparedStatementHandler.update(PreparedStatementHandler.java:46) ~[mybatis-3.4.6.jar:3.4.6]
at org.apache.ibatis.executor.statement.RoutingStatementHandler.update(RoutingStatementHandler.java:74) ~[mybatis-3.4.6.jar:3.4.6]
at org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:50) ~[mybatis-3.4.6.jar:3.4.6]
at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:117) ~[mybatis-3.4.6.jar:3.4.6]
at org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:76) ~[mybatis-3.4.6.jar:3.4.6]
at sun.reflect.GeneratedMethodAccessor176.invoke(Unknown Source) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_112]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_112]
at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:63) ~[mybatis-3.4.6.jar:3.4.6]
at com.sun.proxy.$Proxy95.update(Unknown Source) ~[?:?]
at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:198) ~[mybatis-3.4.6.jar:3.4.6]
at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:185) ~[mybatis-3.4.6.jar:3.4.6]
at sun.reflect.GeneratedMethodAccessor220.invoke(Unknown Source) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_112]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_112]







mysql mybatis emoji






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 14 '18 at 4:52









Rick James

67.5k558100




67.5k558100










asked Oct 31 '18 at 4:21









VainlyhVainlyh

5251511




5251511













  • So you fixed the problem, what it the question?

    – Roman Konoval
    Oct 31 '18 at 9:27











  • I do not know why removed 'jdbcType' can be save success.

    – Vainlyh
    Nov 1 '18 at 7:21











  • In this case your question is incomplete. It lacks the error message that you get and the parameter that you pass to the query.

    – Roman Konoval
    Nov 1 '18 at 9:57











  • Thank you very much for your reply,I have added parameter and exception message.

    – Vainlyh
    Nov 1 '18 at 14:24



















  • So you fixed the problem, what it the question?

    – Roman Konoval
    Oct 31 '18 at 9:27











  • I do not know why removed 'jdbcType' can be save success.

    – Vainlyh
    Nov 1 '18 at 7:21











  • In this case your question is incomplete. It lacks the error message that you get and the parameter that you pass to the query.

    – Roman Konoval
    Nov 1 '18 at 9:57











  • Thank you very much for your reply,I have added parameter and exception message.

    – Vainlyh
    Nov 1 '18 at 14:24

















So you fixed the problem, what it the question?

– Roman Konoval
Oct 31 '18 at 9:27





So you fixed the problem, what it the question?

– Roman Konoval
Oct 31 '18 at 9:27













I do not know why removed 'jdbcType' can be save success.

– Vainlyh
Nov 1 '18 at 7:21





I do not know why removed 'jdbcType' can be save success.

– Vainlyh
Nov 1 '18 at 7:21













In this case your question is incomplete. It lacks the error message that you get and the parameter that you pass to the query.

– Roman Konoval
Nov 1 '18 at 9:57





In this case your question is incomplete. It lacks the error message that you get and the parameter that you pass to the query.

– Roman Konoval
Nov 1 '18 at 9:57













Thank you very much for your reply,I have added parameter and exception message.

– Vainlyh
Nov 1 '18 at 14:24





Thank you very much for your reply,I have added parameter and exception message.

– Vainlyh
Nov 1 '18 at 14:24












1 Answer
1






active

oldest

votes


















1














The table needs to be specified CHARACTER SET utf8mb4.



The connection needs to be specified ut8mb4. I don't know MyBatis, but something like this is needed for JDBC:




Add ?useUnicode=yes&characterEncoding=UTF-8 to the JDBC URL (or maybe it is =true and =utf8)







share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53076260%2ffailure-to-save-emoji-by-sql-in-mybatis-mapper%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    The table needs to be specified CHARACTER SET utf8mb4.



    The connection needs to be specified ut8mb4. I don't know MyBatis, but something like this is needed for JDBC:




    Add ?useUnicode=yes&characterEncoding=UTF-8 to the JDBC URL (or maybe it is =true and =utf8)







    share|improve this answer




























      1














      The table needs to be specified CHARACTER SET utf8mb4.



      The connection needs to be specified ut8mb4. I don't know MyBatis, but something like this is needed for JDBC:




      Add ?useUnicode=yes&characterEncoding=UTF-8 to the JDBC URL (or maybe it is =true and =utf8)







      share|improve this answer


























        1












        1








        1







        The table needs to be specified CHARACTER SET utf8mb4.



        The connection needs to be specified ut8mb4. I don't know MyBatis, but something like this is needed for JDBC:




        Add ?useUnicode=yes&characterEncoding=UTF-8 to the JDBC URL (or maybe it is =true and =utf8)







        share|improve this answer













        The table needs to be specified CHARACTER SET utf8mb4.



        The connection needs to be specified ut8mb4. I don't know MyBatis, but something like this is needed for JDBC:




        Add ?useUnicode=yes&characterEncoding=UTF-8 to the JDBC URL (or maybe it is =true and =utf8)








        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 14 '18 at 4:52









        Rick JamesRick James

        67.5k558100




        67.5k558100






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53076260%2ffailure-to-save-emoji-by-sql-in-mybatis-mapper%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Xamarin.iOS Cant Deploy on Iphone

            Glorious Revolution

            Dulmage-Mendelsohn matrix decomposition in Python