hibernate测试类 helloworld测试类 报错 could not excute statement

hibernate新手问题:org.hibernate.exception.GenericJDBCException: could not execute statement_百度知道
hibernate新手问题:org.hibernate.exception.GenericJDBCException: could not execute statement
能够打印出sql语句,但是执行不了
提问者采纳
看我摆渡号
加我 我帮你
提问者评价
thank you!!
其他类似问题
为您推荐:
hibernate的相关知识
其他1条回答
看看你懂得statment有木有释放
我不太懂,如果是说这些已经关了,能说具体点吗(mit();
session.close();
sessionFactory.close();)
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁org.hibernate.exception.SQLGrammarException: could not execute query_百度知道
org.hibernate.exception.SQLGrammarException: could not execute query
List&&quot,’yyyy’))&
session,’yyyy’))&0){
sqlString=sqlString+&quot.close(); &quot!=null&+&quot.length()&.list();+&quot,hql语句放到数据库中执行都好使;&+& list=q;/;&
Query q=session,’yyyy’)-to_char(
else sqlString=&;
else if(and&quot.configure();0){
sqlString=sqlString+&quot: public List selectDetailBytime(S
Session session =
sessionFactory,String
Configuration configuration = new Configuration().createQuery(sqlString)?部分代码.length()&0){
sqlString=sqlString+& &quot.addEntity(E(to_char(; &&quot.class);&(to_char(sqlQuery,但是在这里就是出错;from Emp&quot,’yyyy’)-to_char(+agemore+&quot,’yyyy’))&gt.length()&
&#47!=null&'
if(!=null& &
if(+agemore+&&#39在ssh框架中;
SessionFactory sessionFactory =+&quot.openSession();(to_char('+ageless+&quot,’yyyy’)-to_char(&#39,出现这种错误.buildSessionFactory(),是为什么呢;
'&' from
Emp where&
String sqlString=&quot
提问者采纳
2,应该是你拼时间的时候出错了1,使用query,使用?占位符.setParameter方法来设置参数值试试,HQL是不能直接在数据库里面直接运行的,直接看,你不要直接把时间拼到HQL里面
提问者评价
其他类似问题
为您推荐:
hibernate的相关知识
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁cou nested exception is org.hibernate.exception.SQLGrammarException: could not execute query - 开源中国社区
当前访客身份:游客 [
当前位置:
Cloud Foundry连上了数据库,但是报了一个异常:& org.springframework.dao.InvalidDataAccessResourceUsageException: cou nested exception is org.hibernate.exception.SQLGrammarException: could not execute query
&String hql = & FROM TUser as u WHERE u.username=? and u.password=?&;
List&TUser&&& &all = super.getHibernateTemplate().find(hql, new Object[] { user.getUsername(), user.getPassword() });
项目数据库层采用Hibernate,同样的代码在本地完全正常,但是部署到Cloud Foundry就报出了这个错误 ,很郁闷 ,想请问Cloud Foundry不支持Hibernate么?还是怎么回事,有没有人和我遇到同样的问题啊。。。求救啊。。。。
共有3个答案
<span class="a_vote_num" id="a_vote_num_
解决了& 我的问题是org.springframework.dao.InvalidDataAccessResourceUsageException: cou SQL [select person0_.id as id0_, person0_.age as age0_, person0_.name as name0_ from Person person0_]; nested exception is org.hibernate.exception.SQLGrammarException: could not execute query
Struts Problem Report
Table 'd464fbff1ed6823808abc.Person' doesn't exist
could not execute query
cou SQL [select person0_.id as id0_, person0_.age as age0_, person0_.name as name0_ from Person person0_]; nested exception is org.hibernate.exception.SQLGrammarException: could not execute query
发现 model里 没写 @table注解,数据库里表示person小写的,然后cloud foundry里拼的语句 是Person大写的表 然后 我加上@table(name=”person“)就好了&
--- 共有 1 条评论 ---
我也遇到这样的问题,在windows下没错,在linux下报错,通过写@Table(name=“表名”)解决了
(3年前)&nbsp&
<span class="a_vote_num" id="a_vote_num_
我遇到了 没解决啊& 一直& lz解决了没?
<span class="a_vote_num" id="a_vote_num_
但是 eclipse里 我@table从来都是不写的 都是表明是实体类名小写,从来没出过错,但是部署到cloud foundry上面 表映射就变成Person表了,不知道怎么回事
更多开发者职位上
有什么技术问题吗?
yzxqml...的其它问题
类似的话题<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
您的访问请求被拒绝 403 Forbidden - ITeye技术社区
您的访问请求被拒绝
亲爱的会员,您的IP地址所在网段被ITeye拒绝服务,这可能是以下两种情况导致:
一、您所在的网段内有网络爬虫大量抓取ITeye网页,为保证其他人流畅的访问ITeye,该网段被ITeye拒绝
二、您通过某个代理服务器访问ITeye网站,该代理服务器被网络爬虫利用,大量抓取ITeye网页
请您点击按钮解除封锁&

我要回帖

更多关于 测试类h5 的文章

 

随机推荐