org.springframework.dao.InvalidDataAccessResourceUsageException: could not execute query; nested exc

org.springframework.dao.InvalidDataAccessResourceUsageException: could not exe

org.springframework.dao.InvalidDataAccessResourceUsageException: could not execute query; nested exc

分类: hibernate Java e 开发   4856人阅读  评论(4)  收藏  举报 nested query generator schema class sqlserver

 org.springframework.dao.InvalidDataAccessResourceUsageException: could not execute query; nested exception is org.hibernate.exception.SQLGrammarException: could not execute query  

 

我的SSH项目原本使用的sqlserver2005数据库现在改用MySql。我改了applicationcontex的配置,我运行了就出现上面的异常错误!

在网上查了一下,有网友说是说没有表什么的,结果查了一下

我以为applicationcontex配置错误,改了又改,参照了又参照····没有查到什么错

我看到网友说 *.hbm.xml配置可能有问题,我就查看了下,然后再看看文档,文档配置如下:

 6    
7       
8          
9              
10      
   
11   
12           ……   
13    
   
14 
   
1. 主键(id)

 而我的配置写的是:


   
    
      
           
      
       
     
        
   

于是我吧不同的schema和catalog注释了


     

    

      
           
      
       
     
        
   

 终于!弄了两天的东西终于出来了!

本人新手,遇到小问题的解决希望能对新手们有用。同时希望有人共同讨论web开发!有高手指点!

加我!!评论!!一起来学习!!

版权声明:本文为博主原创文章,未经博主允许不得转载。