NutzCN Logo
问答 mysql 关于dao.insert报错问题,而sql语句能正常执行
发布于 2763天前 作者 yong9664 2175 次浏览 复制 上一个帖子 下一个帖子
标签:

如题,sql是这样的:
INSERT INTO dct_user(nickname,create_time)
VALUES('??????_?????','2016-09-03 17:22:22')

3 回复

是不是应该贴一下报错内容呢?

来自炫酷的 NutzCN

@wendal

java.sql.SQLException: Incorrect string value: '\xF0\x9F\xA6\x81\xE2\x86...' for column 'nickname' at row 1
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:946)
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2822)
	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1536)
	at com.mysql.jdbc.ServerPreparedStatement.serverExecute(ServerPreparedStatement.java:1159)
	at com.mysql.jdbc.ServerPreparedStatement.executeInternal(ServerPreparedStatement.java:684)
	at com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:768)
	at com.alibaba.druid.pool.DruidPooledPreparedStatement.execute(DruidPooledPreparedStatement.java:493)
	at org.nutz.dao.impl.sql.run.NutDaoExecutor._runPreparedStatement(NutDaoExecutor.java:268)
	at org.nutz.dao.impl.sql.run.NutDaoExecutor.exec(NutDaoExecutor.java:82)
	at org.nutz.dao.impl.DaoSupport$DaoExec.invoke(DaoSupport.java:316)
	at org.nutz.dao.impl.sql.run.NutDaoRunner.run(NutDaoRunner.java:59)
	at org.nutz.dao.impl.DaoSupport.run(DaoSupport.java:239)
	…………

@yong9664 谷歌搜utf8mb4

来自炫酷的 NutzCN

添加回复
请先登陆
回到顶部