Announcement Announcement Module
Collapse
No announcement yet.
Common approach to stored procedure Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    Hi,

    I have tried the same way.. but parameters are not correctly passed to procedure.. I'm trying to invoke procedure inside a package.. All the parameters seems to have null values after passing.. Does any one have same experience? Please help..

    Comment


    • #17
      I followed the same approach (Refering to jakim8915 post) which you have mentioned, in calling the stored procedure, it throws the following exception
      (I have created Prcedure "getStateName" which takes one parameter (StateID) and should return State Name.). Can you please tell me what is that I am missing. Thanks in advance.

      Exception:
      org.springframework.dao.TransientDataAccessResourc eException: CallableStatementCallback; SQL [{call getStateName(?)}]; Callable statments not supported.; nested exception is java.sql.SQLException: Callable statments not supported.
      at org.springframework.jdbc.support.SQLStateSQLExcept ionTranslator.doTranslate(SQLStateSQLExceptionTran slator.java:106)
      at org.springframework.jdbc.support.AbstractFallbackS QLExceptionTranslator.translate(AbstractFallbackSQ LExceptionTranslator.java:72)
      at org.springframework.jdbc.support.AbstractFallbackS QLExceptionTranslator.translate(AbstractFallbackSQ LExceptionTranslator.java:80)
      at org.springframework.jdbc.support.AbstractFallbackS QLExceptionTranslator.translate(AbstractFallbackSQ LExceptionTranslator.java:80)
      at org.springframework.jdbc.core.JdbcTemplate.execute (JdbcTemplate.java:952)
      at org.springframework.jdbc.core.JdbcTemplate.call(Jd bcTemplate.java:985)
      at org.springframework.jdbc.object.StoredProcedure.ex ecute(StoredProcedure.java:117)
      at com.wipro.daoImpl.CallPocedure.execute(CallPocedur e.java:33)
      at com.wipro.daoImpl.CallProcedureDaoImpl.getStateNam e(CallProcedureDaoImpl.java:32)
      at com.wipro.serviceImpl.CallProcedureServiceImpl.get StateName(CallProcedureServiceImpl.java:27)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknow n Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Un known Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.springframework.aop.support.AopUtils.invokeJoi npointUsingReflection(AopUtils.java:307)
      at org.springframework.aop.framework.ReflectiveMethod Invocation.invokeJoinpoint(ReflectiveMethodInvocat ion.java:182)
      at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :149)
      at org.springframework.transaction.interceptor.Transa ctionInterceptor.invoke(TransactionInterceptor.jav a:106)
      at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :171)
      at org.springframework.aop.interceptor.ExposeInvocati onInterceptor.invoke(ExposeInvocationInterceptor.j ava:89)
      at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :171)
      at org.springframework.aop.framework.JdkDynamicAopPro xy.invoke(JdkDynamicAopProxy.java:204)
      at $Proxy1.getStateName(Unknown Source)
      at com.wipro.client.CallProcedureClient.getStateName( CallProcedureClient.java:25)
      at com.wipro.client.CallProcedureClient.main(CallProc edureClient.java:36)
      Caused by: java.sql.SQLException: Callable statments not supported.
      at com.mysql.jdbc.Connection.prepareCall(Connection.j ava:1287)
      at org.springframework.jdbc.core.CallableStatementCre atorFactory$CallableStatementCreatorImpl.createCal lableStatement(CallableStatementCreatorFactory.jav a:167)
      at org.springframework.jdbc.core.JdbcTemplate.execute (JdbcTemplate.java:930)
      Last edited by MPatric; Jul 1st, 2011, 12:23 AM.

      Comment


      • #18
        1. Such questions should be posted Data forum (http://forum.springsource.org/forumdisplay.php?27-Data).
        2. It looks as if a JDBC driver you are using does not support a stored procedures (nested exception is java.sql.SQLException: Callable statments not supported.). So you either have to use a different JDBC driver for your DB (if exists) or use another DB.

        Comment

        Working...
        X