Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8892341
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T22:58:31+00:00 2026-06-14T22:58:31+00:00

Exception Exception in thread main org.springframework.jdbc.BadSqlGrammarException: StatementCallback; bad SQL grammar [\. D:\Documents\workspace-sts-3.0.0.RELEASE\groupbased\src\test\resources\stress\storedProcedures.sql]; nested exception

  • 0

Exception

Exception in thread "main" org.springframework.jdbc.BadSqlGrammarException: StatementCallback; bad SQL grammar [\. D:\Documents\workspace-sts-3.0.0.RELEASE\groupbased\src\test\resources\stress\storedProcedures.sql]; nested exception is 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 '\. D:\Documents\workspace-sts-3.0.0.RELEASE\groupbased\src\test\resources\stress' at line 1

Java Code

template.execute("USE example_db;");
template.execute("\\. D:\\Documents\\workspace-sts-3.0.0.RELEASE\\groupbased\\src\\test\\resources\\stress\\storedProcedures.sql");

(template is a JDBCTemplate)

I can run the command fine through the mysql console, but I get this error any time I try to do it through JDBCTemplate execute. Any suggestions?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T22:58:32+00:00Added an answer on June 14, 2026 at 10:58 pm

    Yes. Try reading the contents of the file into a String and passing that to the template.

    The javadocs say that the argument should be the actual SQL, not a file path.

    http://static.springsource.org/spring/docs/3.0.6.RELEASE/api/org/springframework/jdbc/core/JdbcTemplate.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am getting following exception while authenticating a user: Exception in thread main org.springframework.ldap.PartialResultException:
Exception in thread main org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.aop.aspectj.AspectJPointcutAdvisor#0': Instantiation of bean
Spring framework throws Exception in thread main java.lang.NoSuchMethodError: org.slf4j.spi.LocationAwareLogger.log(Lorg/slf4j/Marker;Ljava/lang/String;ILjava/lang/String;Ljava/lang/Throwable;)V at org.apache.commons.logging.impl.SLF4JLocationAwareLog.info(SLF4JLocationAwareLog.java:159) at org.springframework.context.support.AbstractApplicationContext.prepareRefresh(AbstractApplicationContext.java:454) at
Exception in thread main java.lang.NullPointerException at Library.loadBooks(Library.java:179) at UseLibrary.main(UseLibrary.java:105) This error makes me crazy!
I have the following error Exception in thread main javax.naming.NameNotFoundException: CounterBean not bound trying
if I run java -classpath ./sqljdbc4.jar myclassname error is Exception in thread main java.lang.NoClassDefFoundError:myclassname
I'm having a problem where I receive this error: Exception in thread main java.lang.NullPointerException
I'm trying out an implementation of QuickSort but getting an Exception in thread main
Exception in thread Thread-0 java.lang.NullPointerException at org.apache.http.impl.nio.reactor.AbstractIOReactor.closeActiveChannels(AbstractIOReactor.java:532) at org.apache.http.impl.nio.reactor.AbstractIOReactor.hardShutdown(AbstractIOReactor.java:564) at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor.doShutdown(AbstractMultiworkerIOReactor.java:411) at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor.execute(AbstractMultiworkerIOReactor.java:340) at
Here is My Exception Exception in thread main java.lang.IllegalArgumentException: Property 'sessionFactory' is required at

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.