欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  web前端

SQLite 关联查询报错,不是sql语法错误,如下,出现好多次了,求大神给看看_html/css_WEB-ITnose

程序员文章站 2022-06-05 09:27:14
...
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实现类运行就报以上错误
求解决!!!


回复讨论(解决方案)

放五一都没个人了??????????????????哎

.... (
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语法,就可以解决!

解决了!哎,五一都没人呢?

楼主自己怎么解决的给总结一下,也好给别的人一个参考嘛 :)