Hibernate Books

All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: call mysql stored procedure from hibernate code.
PostPosted: Wed Aug 11, 2010 9:57 am 
Newbie

Joined: Wed Aug 11, 2010 9:44 am
Posts: 2
Hi everyone,
I'm new to the hibernate technology. Currently i'm facing the problem while calling the stored procedure from hibernate code.
My procedure is in the MySQL database and hibernate version is 3.0.
The Exception is as,-
1047 [main] WARN org.hibernate.util.JDBCExceptionReporter - SQL Error: 1312, SQLState: 0A000
1047 [main] ERROR org.hibernate.util.JDBCExceptionReporter - PROCEDURE smpptwodlrs.getContactRecords can't return a result set in the given context
org.hibernate.exception.GenericJDBCException: could not execute query
at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:126)
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:114)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
at org.hibernate.loader.Loader.doList(Loader.java:2231)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2125)
at org.hibernate.loader.Loader.list(Loader.java:2120)
at org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:312)
at org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1722)
at org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:165)
at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:175)
at roseindia.tutorial.hibernate.SelectHQLExample.main(SelectHQLExample.java:25)
Caused by: java.sql.SQLException: PROCEDURE smpptwodlrs.getContactRecords can't return a result set in the given context
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1997)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1167)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1278)
at com.mysql.jdbc.Connection.execSQL(Connection.java:2251)
at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1586)
at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:208)
at org.hibernate.loader.Loader.getResultSet(Loader.java:1808)
at org.hibernate.loader.Loader.doQuery(Loader.java:697)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259)
at org.hibernate.loader.Loader.doList(Loader.java:2228)
... 7 more
could not execute query
Exception::org.hibernate.exception.GenericJDBCException: could not execute query


Any help will be appreciated.

Thanking you.


Top
 Profile  
 
 Post subject: Re: call mysql stored procedure from hibernate code.
PostPosted: Thu Aug 12, 2010 9:25 am 
Newbie

Joined: Wed Aug 11, 2010 9:44 am
Posts: 2
Hi everyone,

This problem has been solved now. Actual there was not the issue with hibernate code.
But the jar required for the MySQL DB connectivity was old.
I simply upgrade this jar version(MySQL-Connector) to mysql-connector-java-5.1.12-bin.jar and exception gets removed.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.