Org.springframework.jdbc.BadSqlGrammarException:CallableStatementCallback; Bad SQL Grammar

Source: Internet
Author: User

Through spring's jdbctemplate call to the MySQL stored procedure, the following problems appear (previously also used, and did not appear below the problem, tossing large half-day, depressed):

Start reporting the following error:


[INFO]2014-07-01 10:49:15,297 message:loading XML Bean Definitions from class path resource [org/springframework/jdbc/s Upport/sql-error-codes.xml]

[INFO]2014-07-01 10:49:15,413 message:sqlerrorcodes loaded: [DB2, Derby, H2, HSQL, Informix, Ms-sql, MySQL, Oracle, Pos Tgresql, Sybase]


No more error messages, no response in the database. Then, by joining try () catch{}, you can print out the following main error message:


Org.springframework.jdbc.BadSqlGrammarException:CallableStatementCallback; Bad SQL Grammar []; Nested exception is Com.mysql.jdbc.exceptions.MySQLSyntaxErrorException:You has an error in your SQL syntax; Check the manual-corresponds to your MySQL server version for the right syntax-use near "res") ' at line 1


According to the error, it should be a SQL syntax error, but in the navicat execution, no problem, I was depressed.

Create a stored procedure statement Yes, the Navicat tool was created by steps:


CREATE definer= ' root ' @ ' localhost ' PROCEDURE ' huabei_dhqr_id ' (out ' res ' varchar (32))


The quotation marks in the argument are then removed, instead:


CREATE definer= ' root ' @ ' localhost ' PROCEDURE ' huabei_dhqr_id ' (out res varchar (32))


Executable Success!


This article comes from the "Quietboy's blog" blog, please be sure to keep this source http://quietboy.blog.51cto.com/6711298/1432984

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.