hibernate在tomcat中的错误(非常急在线给分~!!!!!!!!!!!!!!!!)

sunangle 2006-09-25 10:29:36
一个应用程序和数据库在同事的计算机上没有错误;而在的上面老有错误
我的环境jdk1.5+tomcat5.0.30+mysql4.1.11+mysql driver 3.1.6+hibernate2.0

2006-09-25 10:24:34,843 WARN [net.sf.hibernate.util.JDBCExceptionReporter] - <SQ
L Error: 1064, SQLState: 42000>
2006-09-25 10:24:34,843 ERROR [net.sf.hibernate.util.JDBCExceptionReporter] - <Y
ou have an error in your SQL syntax; check the manual that corresponds to your M
ySQL server version for the right syntax to use near '?' at line 1>
2006-09-25 10:24:34,843 WARN [net.sf.hibernate.util.JDBCExceptionReporter] - <SQ
L Error: 1064, SQLState: 42000>
2006-09-25 10:24:34,843 ERROR [net.sf.hibernate.util.JDBCExceptionReporter] - <Y
ou have an error in your SQL syntax; check the manual that corresponds to your M
ySQL server version for the right syntax to use near '?' at line 1>
...全文
345 14 打赏 收藏 转发到动态 举报
写回复
用AI写文章
14 条回复
切换为时间正序
请发表友善的回复…
发表回复
sunangle 2006-09-27
  • 打赏
  • 举报
回复
问题解决以前的程序用的
mysql驱动是mysql connector 3.1.7我用3.1.6就不行。
ukinglli 2006-09-27
  • 打赏
  • 举报
回复
mySQL 版本不一致?
ukinglli 2006-09-26
  • 打赏
  • 举报
回复
你分页的时候设置的参数不对,请检查你的分页模块的实现吧,limit 这里的参数
piggerman 2006-09-26
  • 打赏
  • 举报
回复
语法错误,这个是mysql爆出的错误
sunangle 2006-09-26
  • 打赏
  • 举报
回复
qingoodrar(神吹)
我在hibernate-config.xml中加了此属性但是由于同事以前写程序写到jar包中没有办法改;

点对应连接执行在tomcat中出现下面错误
Hibernate: select tbcontenta0_.Id as Id, tbcontenta0_.NodeId as NodeId, tbconten
ta0_.Title as Title, tbcontenta0_.TitleStyle as TitleStyle, tbcontenta0_.Brief a
s Brief, tbcontenta0_.BriefStyle as BriefStyle, tbcontenta0_.pic1 as pic1, tbcon
tenta0_.pic2 as pic2, tbcontenta0_.pic3 as pic3, tbcontenta0_.pic4 as pic4, tbco
ntenta0_.var1 as var1, tbcontenta0_.var2 as var2, tbcontenta0_.var3 as var3, tbc
ontenta0_.var4 as var4, tbcontenta0_.Note as Note, tbcontenta0_.NoteStyle as Not
eStyle, tbcontenta0_.Source as Source, tbcontenta0_.SourceStyle as SourceS18_, t
bcontenta0_.KeyWords as KeyWords, tbcontenta0_.UpdateTime as UpdateTime, tbconte
nta0_.PublishTime as Publish21_, tbcontenta0_.PublishTimeStyle as Publish22_, tb
contenta0_.Author as Author, tbcontenta0_.AuthorStyle as AuthorS24_, tbcontenta0
_.Content as Content, tbcontenta0_.ContentEdited as Content26_, tbcontenta0_.Edi
tor as Editor, tbcontenta0_.Publisher as Publisher, tbcontenta0_.IsDisplay as Is
Display, tbcontenta0_.State as State, tbcontenta0_.FileName as FileName, tbconte
nta0_.Sort as Sort, tbcontenta0_.Count as Count from tb_content_articles tbconte
nta0_ where (tbcontenta0_.NodeId=1 )and(tbcontenta0_.State=0 ) order by tbconte
nta0_.Sort desc limit ?
2006-09-26 09:48:04,671 WARN [net.sf.hibernate.util.JDBCExceptionReporter] - <SQ
L Error: 1064, SQLState: 42000>
2006-09-26 09:48:04,671 ERROR [net.sf.hibernate.util.JDBCExceptionReporter] - <Y
ou have an error in your SQL syntax; check the manual that corresponds to your M
ySQL server version for the right syntax to use near '?' at line 1>
2006-09-26 09:48:04,671 WARN [net.sf.hibernate.util.JDBCExceptionReporter] - <SQ
L Error: 1064, SQLState: 42000>
2006-09-26 09:48:04,671 ERROR [net.sf.hibernate.util.JDBCExceptionReporter] - <Y
ou have an error in your SQL syntax; check the manual that corresponds to your M
ySQL server version for the right syntax to use near '?' at line 1>
Hibernate: select tbcontentn0_.Id as Id, tbcontentn0_.ParentId as ParentId, tbco
ntentn0_.Label as Label, tbcontentn0_.Type as Type, tbcontentn0_.Img as Img, tbc
ontentn0_.Sort as Sort, tbcontentn0_.About as About, tbcontentn0_.RegistTime as
RegistTime, tbcontentn0_.IsDisplay as IsDisplay from tb_content_node tbcontentn0
_ where (tbcontentn0_.Id=1 )and(tbcontentn0_.ParentId<>0 ) order by tbcontentn0
_.Id
sunangle 2006-09-26
  • 打赏
  • 举报
回复
问题找到了关键是在相同环境下在同事的计算机上可以跑 在我的系统上跑就有问题,郁闷无比了!!!!!!!!!
wrong1111 2006-09-26
  • 打赏
  • 举报
回复
楼上说的有道理。最后LIMIT 的参数
li_d_s 2006-09-25
  • 打赏
  • 举报
回复
hql写的不对
qingoodrar 2006-09-25
  • 打赏
  • 举报
回复
好像是SQL语法有错??
You have an error in your SQL syntax;
查你数据库错误码:1064是什么意思,再加以解决!
awded 2006-09-25
  • 打赏
  • 举报
回复
hql 有问题,去查查吧。或者你把dialect 搞错了?
qingoodrar 2006-09-25
  • 打赏
  • 举报
回复
设置你的hibernate的配置文件的这个结点:
<property name="hibernate.show_sql">true</property>
把SQL语句打出来,这样的情况是由于HQL有误然后经hibernate转换为错误的sql语句所致!
所以打出SQL语句后好确定问题所在!
xiaomad 2006-09-25
  • 打赏
  • 举报
回复
这些启动信息不是错误。
你打开hibernate的debuglog,把出错前的SQL文刷出来看看。
sunangle 2006-09-25
  • 打赏
  • 举报
回复
老大我都检查了HQL没有错误.
我在检查tomcat启动过程中发现下面错误;
2006-09-25 11:30:41,781 INFO [net.sf.hibernate.impl.SessionFactoryImpl] - <build
ing session factory>
2006-09-25 11:30:49,484 INFO [net.sf.hibernate.impl.SessionFactoryObjectFactory]
- <Not binding factory to JNDI, no JNDI name configured>
@hibernate: The hibernate SessionFactory has been started... ...





2006-09-25 14:18:44,468 INFO [net.sf.hibernate.connection.DatasourceConnectionPr
ovider] - <Using datasource: java:comp/env/jdbc/rjzysy>
2006-09-25 14:18:44,484 INFO [net.sf.hibernate.transaction.TransactionFactoryFac
tory] - <Transaction strategy: net.sf.hibernate.transaction.JDBCTransactionFacto
ry>
2006-09-25 14:18:44,515 INFO [net.sf.hibernate.transaction.TransactionManagerLoo
kupFactory] - <No TransactionManagerLookup configured (in JTA environment, use o
f process level read-write cache is not recommended)>


常遇道 2006-09-25
  • 打赏
  • 举报
回复
验查一下hql写法

67,513

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧