问答详情
源自:2-5 JDBC实战---搭建模型层 Ⅲ

老师,您好,这是什么异常啊

Exception in thread "main" com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '('?°??¤?',1,22,'2015-09-12','xiaoxia@imooc.com','18777777777','mjjj',current_dat' at line 1

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)

at java.lang.reflect.Constructor.newInstance(Constructor.java:513)

at com.mysql.jdbc.Util.handleNewInstance(Util.java:400)

at com.mysql.jdbc.Util.getInstance(Util.java:383)

at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:980)

at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3847)

at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3783)

at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2447)

at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2594)

at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2545)

at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1901)

at com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:1193)

at com.imooc.dao.GoddessDao.addGoddess(GoddessDao.java:33)

at com.imooc.action.Goddessaction.main(Goddessaction.java:27)


提问者:初生牛犊zjh 2015-09-12 08:55

个回答

  • 忘性最大的人
    2015-09-12 23:28:30

    可能是语句书写错误了吧,一般叫你检查mysql版本的都是语句没有书写正确,大概是逗号或者空格的问题,好好检查一下sql语句。