往数据库text类型字段 加数据出现问题com.mysql.jdbc.exceptions.MySQLSyntaxErrorException:

袁赫_ 2013-07-29 04:56:16
所加数据是如下:
Switch and match your way through more than 300 levels in this delicious and addictive puzzle adventure. Ain't it the sweetest game ever?

Please note: Candy Crush Saga is completely free to play but some in-game items such as extra moves or lives will require payment. You can turn-off the payment feature by disabling in-app purchases in your device’s settings.

The super hit game Candy Crush Saga is now available for iPhone, iPad and iPod Touch!
-------------------------------

Join Tiffi and Mr. Toffee in their epic adventure through a world full of candy.

Take on this deliciously sweet saga alone or play with friends to see who can get the highest score!

-------------------------------

Candy Crush Saga features:
Tasty graphics that will leave you hungry for more
Easy and fun to play, but a challenge to fully master
Over 100 sweet levels
Leaderboards for you and your friends
Items to unlock by completing levels
Boosters and charms to help with those challenging levels
Seamless synchronization with the Facebook version
-------------------------------

Last, but not least, a big THANK YOU goes out to everyone who has played Candy Crush Saga!

Already a fan of Candy Crush Saga? Like us on Facebook or follow us on Twitter for the latest news:

facebook.com/CandyCrushSaga
twitter.com/CandyCrushSaga

*Minimum iOS version recommended: 4.3.5*
语句是:
String sql = "insert into AppInfo(aDescription) values('"+des+"')";
err:
com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 't it the sweetest game ever?

Please note: Candy Crush Saga is completely free t' at line 1
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:936)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2985)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1631)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1723)
at com.mysql.jdbc.Connection.execSQL(Connection.java:3277)
at com.mysql.jdbc.Connection.execSQL(Connection.java:3206)
at com.mysql.jdbc.Statement.execute(Statement.java:727)
at com.yh.MysqlJdbc.insert(MysqlJdbc.java:37)
at com.yh.CaptureApp.DBexec(CaptureApp.java:199)
at com.yh.CaptureApp.exe(CaptureApp.java:40)
at com.yh.CaptureApp.main(CaptureApp.java:206)
不知道是什么问题?
...全文
92 2 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
ACMAIN_CHM 2013-08-21
  • 打赏
  • 举报
回复
单步调试,检查String sql 的实际内容是什么,估计是有单引号你没有转义。
yhm_new 2013-08-21
  • 打赏
  • 举报
回复
引号的问题吧

56,937

社区成员

发帖
与我相关
我的任务
社区描述
MySQL相关内容讨论专区
社区管理员
  • MySQL
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧