当前位置: 代码迷 >> Java Web开发 >> org.springframework.jdbc.BadSqlGrammarException:   Bad   SQL  
  详细解决方案

org.springframework.jdbc.BadSqlGrammarException:   Bad   SQL  

热度:585   发布时间:2016-04-17 16:51:18.0
高手求助!!!!!!!!!!!!1
2007-01-22   11:11:57,968   [com.ascent.dao.hibernate.CustomerHibernateDAO]-[DEBUG]   根据用户姓名得到用户信息!
Hibernate:   select   customer0_.customer_id   as   customer1_,   customer0_.cust_name   as   cust_name,   customer0_.password   as   password,   customer0_.email   as   email   from   customer   customer0_   where   (customer0_.cust_name=?   )   order   by     customer0_.customer_id   desc
2007-01-22   11:11:58,203   [net.sf.hibernate.util.JDBCExceptionReporter]-[WARN]   SQL   Error:   0,   SQLState:   S0022
2007-01-22   11:11:58,203   [net.sf.hibernate.util.JDBCExceptionReporter]-[ERROR]   Column   'customer1_ '   not   found.
2007-01-22   11:11:58,218   [net.sf.hibernate.util.JDBCExceptionReporter]-[WARN]   SQL   Error:   0,   SQLState:   S0022
2007-01-22   11:11:58,218   [net.sf.hibernate.util.JDBCExceptionReporter]-[ERROR]   Column   'customer1_ '   not   found.
2007-01-22   11:11:58,218   [com.ascent.dao.hibernate.CustomerHibernateDAO]-[ERROR]   根据用户姓名获取用户信息失败!
org.springframework.jdbc.BadSqlGrammarException:   Bad   SQL   grammar   []   in   task   'Hibernate   operation ';   nested   exception   is   java.sql.SQLException:   Column   'customer1_ '   not   found.
java.sql.SQLException:   Column   'customer1_ '   not   found.


哪位能看一下这是什么问题!配置文件都没问题!就是跑不过去!检查又检查!。。。。。。。

------解决方案--------------------
你的hibernate配置跟你的数据库表结构不一样,在你要操作的表中没有customer1_这个字段。
  相关解决方案