调用带输出参数的存储过程出错

来源:2-4 JDBC存储过程之调用带输出参数的存储过程

ISU4869

2018-09-13 10:12

com.mysql.jdbc.exceptions.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 '`count`)' at line 1

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

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

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

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

at com.mysql.jdbc.Connection.execSQL(Connection.java:3249)

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

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

at com.mysql.jdbc.CallableStatement.execute(CallableStatement.java:752)

at dao.ProcedureDAO.select_count(ProcedureDAO.java:65)

at test.ProcedureTest.select_count(ProcedureTest.java:48)

at test.ProcedureTest.main(ProcedureTest.java:26)

https://img2.mukewang.com/5b99c77f0001851b05860527.jpg

写回答 关注

3回答

  • HungerCheung
    2018-11-07 12:06:53

    把你相关的java的代码贴出来一下

  • 桑桑桑
    2018-10-20 16:49:49

    CREATE PROCEDURE sp_select_count(OUT count INT(10))

    BEGIN

    SELECT COUNT(*) INTO count FROM imooc_goddess;

    END


  • 慕粉4001965
    2018-09-19 21:10:32

    SQL语法错误 第一行代码错了

JDBC之“对岸的女孩走过来”

JDBC的深入挖掘,主要介绍在实际开发过程中的各种知识

49827 学习 · 86 问题

查看课程

相似问题