user1738224
user1738224

Reputation: 23

sql query work when run it in sqlDeveloper but not work using hibernate

i have a query that i want to run it using hibernate native sqlQuery

when i run query using sql developer it works fine but when hibernate run it ,it throws this exception

.
.
.

 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

here is my sql query:

SELECT car_id,car.plate FROM car WHERE car.plate LIKE '%12%' ORDER BY CAR.CAR_ID;

please help me ,

thanks in advance

Upvotes: 1

Views: 1742

Answers (2)

jompi
jompi

Reputation: 360

Remove your semicolon ";". Cheers.

Upvotes: 6

Orion_Blackstock
Orion_Blackstock

Reputation: 179

Hibernate is case sentitive, write your sql statement in lower case. Example:

select car_id,car.plate from car car where car.plate like '%12%' order by car.car_id asc;

Upvotes: 0

Related Questions