Hi All, I am getting some syntax related issue while executing store procedure with SQL SERVER
i.e (15:33:43,053 INFO [stdout] (http-localhost-127.0.0.1-5050-7) query -- SQLQueryImpl({call SquareSP3(:MyFirstParam)}) 15:33:43,894 WARN [org.hibernate.util.JDBCExceptionReporter] (http-localhost-127.0.0.1-5050-7) SQL Error: 0, SQLState: null 15:33:43,895 ERROR [org.hibernate.util.JDBCExceptionReporter] (http-localhost-127.0.0.1-5050-7) A result set was generated for update. 15:33:44,175 WARN [org.hibernate.util.JDBCExceptionReporter] (http-localhost-127.0.0.1-5050-7) SQL Error: 102, SQLState: S0001 15:33:44,177 ERROR [org.hibernate.util.JDBCExceptionReporter] (http-localhost-127.0.0.1-5050-7) Incorrect syntax near '{'. 15:33:44,180 ERROR [stderr] (http-localhost-127.0.0.1-5050-7) org.hibernate.exception.SQLGrammarException: could not execute query 15:33:44,182 ERROR [stderr] (http-localhost-127.0.0.1-5050-7) at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67) 15:33:44,183 ERROR [stderr] (http-localhost-127.0.0.1-5050-7) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43) 15:33:44,185 ERROR [stderr] (http-localhost-127.0.0.1-5050-7) at org.hibernate.loader.Loader.doList(Loader.java:2223) 15:33:44,186 ERROR [stderr] (http-localhost-127.0.0.1-5050-7) at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104) 15:33:44,188 ERROR [stderr] (http-localhost-127.0.0.1-5050-7) at org.hibernate.loader.Loader.list(Loader.java:2099) 15:33:44,190 ERROR [stderr] (http-localhost-127.0.0.1-5050-7) at org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:289))
I am using jboss server 7.1, sql server 2012, jdk 1.6, and hibernate 3. I created datasource in jboss server for that I used one jar file i.e sqljdbc4-3.0.jar.
The entry for calling SP in .hbm file
<sql-query name="getDistributionListCri[b][/b]teria"> {call SquareSP3(:keyParam)} </sql-query>
Note:if I am specifying db connection related details in hibernate configuration file then I am not getting any issue related to store procedure, but if I specify db connection details in jboss using datasource then everything is working fine except store procedure.
Can anybody help on it or guide me what is the actual issue?
|