-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: MySQLDialect not support resultsets via stored procedures
PostPosted: Tue Dec 06, 2005 9:26 pm 
Newbie

Joined: Tue Dec 06, 2005 8:12 pm
Posts: 1
Hi,

I'm experimenting with hibernate and MySQL 5.0. I have been trying to see if I can define a loader that uses a MySQL 5.0 stored procedure. Unfortunately, I get the following error:

Code:
   [java] Exception in thread "main" java.lang.UnsupportedOperationException: org.hibernate.dialect.MySQLDialect does not support
resultsets via stored procedures


This is in hibernate 3.1rc3. If I change the dialect to SQLServerDialect the loader works fine, but of course that could mess up other mappings.

So I hacked the MySQLDialect.java file to more resemble the SQLServerDialect file.

Added the following imports:

Code:
import java.sql.CallableStatement;
import java.sql.ResultSet;
import java.sql.SQLException;


and the following methods:

Code:
   public int registerResultSetOutParameter(CallableStatement statement, int col) throws SQLException {
      return col;
   }
   
   public ResultSet getResultSet(CallableStatement ps) throws SQLException {
      boolean isResultSet = ps.execute();
      while (!isResultSet && ps.getUpdateCount() != -1) {
          isResultSet = ps.getMoreResults();
      }
      ResultSet rs = ps.getResultSet();
      return rs;
   }


That seemed to work. I'm new to hibernate, how would I go about registering a formal change request to get this support in the official release?

Thanks,

Guy


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 06, 2005 9:34 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
submit a patch to jira.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.