org.hibernate.dialect.MySQLDialect   does   not   support   resultsets   via   stored   procedures
错误比较明显了吧
看看你的存储过程返回的是什么数据
MySQLDialect不支持存储过程返回结果集?

解决方案 »

  1.   

    不能呀,我看到网上的例子,都是用的org.hibernate.dialect.MySQLDialect呀
    如果不行,Mysql如何得到结果集
      

  2.   

    把你的存储过程代码贴一下
    还有用到MySQLDialect的那段代码
    真晕死
    这都不贴出来怎么看问题啊
      

  3.   

    以下是对应的Mysql存储过程,我在mysql qurey browser中运行了,很正常
    DELIMITER $$DROP PROCEDURE IF EXISTS `qfy`.`HomeMsg_getMsg` $$
    CREATE DEFINER=`root`@`localhost` PROCEDURE `HomeMsg_getMsg`(in homeN integer)
    begin
      declare hmsgcount integer;  select count(hmsgID) into hmsgcount
        from homeMsg where homeId=homeN
        and DATEDIFF (CURRENT_DATE (),date(hmsgDate))=0;  if hmsgcount=0 then
        select hmsgMessage,hmsgUrl,hmsgTitle from homeMsg where homeID=homeN
          and hmsgDate=(select max(hmsgDate) from homeMsg where homeID=homeN and hmsgDate<CURRENT_DATE ());
      else
        select hmsgMessage,hmsgUrl,hmsgTitle
          from homeMsg where homeId=homeN
          and DATEDIFF (CURRENT_DATE (),date(hmsgDate))=0;
      end if;
    end $$DELIMITER ;
      

  4.   

    http://opensource.atlassian.com/projects/hibernate/browse/HHH-1244下载上面的MySQLDialect.java 文件Hibernate reports the following when attempting to use a stored procedure to implement load() or getNamedQuery:[java] Exception in thread "main" java.lang.UnsupportedOperationException: org.hibernate.dialect.MySQLDialect does not support resultsets via stored procedures.The MySQLDialiect file needs to be modified to reflect the MySQL5 capability of issuing stored procedures. The semantics of stored procedures in MySQL is most similar to that in SQLServer, so copying the relevent sections of the SQLServerDialect ought to be sufficient. I tried that and it seemed to work. Modified MySQLDialect is attached
      

  5.   

    是hibernate包过时了,正如你所做的,更新开发环境和驱动,其实这个问题只更新hibernsate包就可以了,网上到处都可以找到这个包