日期:2014-05-18  浏览次数:20595 次

Hibernate執行查詢出錯ˍ高手請進
HQL:   "from   Room   room   where   room.endDt   > =   ?   and   room.startDt   <=   ? "
出現的錯誤信息:
2007-09-05   15:15:19   Hibernate   operation:   could   not   execute   query;   bad   SQL   grammar  
[   select   room0_.name   as   name,room0.id   as   id   ,room0_.modificationDate     as   odificationDate  
from   appointment   room0_  
where   (room0_.end_dt> =?   )and(room0_.start_dt <=?   )and(room0_.entry_by= 'PMC_ITD_KL '   )  
order   by     room0_.modificationDate   DESC];  
nested   exception   is   java.sql.SQLException:   Syntax   error   or   access   violation   message   from   server:   "You   have   an   error   in   your   SQL   syntax;   check   the   manual   that   corresponds   to   your   MySQL   server   version   for   the   right   syntax   to   use   near   '100   room0_.id   as   id,   room0_.subject   as   subject1_,   room0_.resource_code   as   resour '   at   line   1 "


------解决方案--------------------
你这个是sql语法错误,看看哪里写错了
------解决方案--------------------
那就是小错误 比如 ' '没写什么的 自己检查啊