[英]sql query work when run it in sqlDeveloper but not work using hibernate
我有一個查詢,我想使用休眠的本機sqlQuery運行它
當我使用sql Developer運行查詢時,它工作正常,但是當hibernate運行它時,它將拋出此異常
.
.
.
Caused by: org.hibernate.exception.SQLGrammarException: could not extract ResultSet
at org.hibernate.exception.internal.SQLExceptionTypeDelegate.convert(SQLExceptionTypeDelegate.java:82)
.
.
.
Caused by: java.sql.SQLSyntaxErrorException: ORA-00911: invalid character
這是我的SQL查詢:
SELECT car_id,car.plate FROM car WHERE car.plate LIKE '%12%' ORDER BY CAR.CAR_ID;
請幫我 ,
提前致謝
刪除分號“;”。 干杯。
Hibernate是大小寫敏感的,用小寫形式編寫您的sql語句。 例:
select car_id,car.plate from car car where car.plate like '%12%' order by car.car_id asc;
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.