Two Laptop Bag*
The moose likes Object Relational Mapping and the fly likes net.sf.hibernate.JDBCException: Could not execute query Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "net.sf.hibernate.JDBCException: Could not execute query" Watch "net.sf.hibernate.JDBCException: Could not execute query" New topic
Author

net.sf.hibernate.JDBCException: Could not execute query

ramesh rbabu
Greenhorn

Joined: Feb 01, 2007
Posts: 1
I am getting the following error

net.sf.hibernate.JDBCException: Could not execute query
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1547)
at net.sf.hibernate.impl.QueryImpl.list(QueryImpl.java:39)
at com.caremark.hmgmt.phmcyadvsr.carecall.dao.hibernate.TokensDaoHibImpl.listTokens(TokensDaoHibImpl.java:28)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:615)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:299)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:139)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
at $Proxy68.listTokens(Unknown Source)
at com.caremark.hmgmt.phmcyadvsr.carecall.dataprovider.DataProviderFactory.initTokens(DataProviderFactory.java:155)
at com.caremark.hmgmt.phmcyadvsr.carecall.dataprovider.DataProviderFactory.init(DataProviderFactory.java:104)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:615)

when i inspect the code i found that it throws from the below line

tokens = getSession().getNamedQuery("loadTokensQuery").list();

upto getSession().getNamedQuery("loadTokensQuery") works fine only .list() method throws the exception.

please help me to find out the fix.

thanks
Ramesh
Anantha Sharma
Ranch Hand

Joined: Sep 01, 2010
Posts: 43

looks like there is something wrong with your query.. can you try and execute the query in the db directly & check if its working fine...

also please post the full stack trace.. there must be a SQLException thrown which is not added as part of your post.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: net.sf.hibernate.JDBCException: Could not execute query