SQLite 关联查询报错,不是sql语法错误,如下,出现好多次了,求大神给看看_html/css_WEB-ITnose
程序员文章站
2022-05-27 22:21:01
...
HTTP Status 500 - Request processing failed; nested exception is org.springframework.transaction.TransactionSystemException: Could not roll back Hibernate transaction; nested exception is org.hibernate.TransactionException: rollback failed
↓
root cause
org.springframework.transaction.TransactionSystemException: Could not roll back Hibernate transaction; nested exception is org.hibernate.TransactionException: rollback failed
↓
org.hibernate.TransactionException: unable to rollback against JDBC connection
↓
root cause
java.sql.SQLException: SQL logic error or missing database
SQL语句:select name,phone,idcard,nowlive,ofCompany,stationCode,type,status,certificatecode from(
select p.name,p.phone,p.idcard,p.nowlive,p.ofcompany ,p.stationcode ,p.type,p.status,z.CertificateCode
FROM basicperson p join BasicZhengJ z on p.phone=z.phone)
很简单的子查询,可以在查询分析器正确执行,放入dao实现类运行就报以上错误
求解决!!!
首先感谢版主的问候,其次,我试了没用,SQL语句没有错
↓
root cause
org.springframework.transaction.TransactionSystemException: Could not roll back Hibernate transaction; nested exception is org.hibernate.TransactionException: rollback failed
↓
org.hibernate.TransactionException: unable to rollback against JDBC connection
↓
root cause
java.sql.SQLException: SQL logic error or missing database
SQL语句:select name,phone,idcard,nowlive,ofCompany,stationCode,type,status,certificatecode from(
select p.name,p.phone,p.idcard,p.nowlive,p.ofcompany ,p.stationcode ,p.type,p.status,z.CertificateCode
FROM basicperson p join BasicZhengJ z on p.phone=z.phone)
很简单的子查询,可以在查询分析器正确执行,放入dao实现类运行就报以上错误
求解决!!!
回复讨论(解决方案)
放五一都没个人了??????????????????哎
.... (
select p.name,p.phone,p.idcard,p.nowlive,p.ofcompany ,p.stationcode ,p.type,p.status,z.CertificateCode
FROM basicperson p join BasicZhengJ z on p.phone=z.phone) T
需要指定别名
.... (
select p.name,p.phone,p.idcard,p.nowlive,p.ofcompany ,p.stationcode ,p.type,p.status,z.CertificateCode
FROM basicperson p join BasicZhengJ z on p.phone=z.phone) T
需要指定别名
首先感谢版主的问候,其次,我试了没用,SQL语句没有错
用HQL语法,就可以解决!
解决了!哎,五一都没人呢?
楼主自己怎么解决的给总结一下,也好给别的人一个参考嘛 :)
上一篇: php用正则表达式匹配中文实例详解
下一篇: Google 2011校园招聘笔试题