This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes unexpected token Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "unexpected token" Watch "unexpected token" New topic

unexpected token

raj chopra
Ranch Hand

Joined: Apr 09, 2012
Posts: 60
Hi All,

i am using hibernate,springs,struts in my project.
i am trying to fetch a value from a table in oracle db, when i am trying to do so i get the below error

org.springframework.orm.hibernate3.HibernateQueryException: unexpected token: org near line 1, column 125 [se
lect org.ein from org, billwhere org.organizationId
=bill.organizationid and bill.organizationid=?]; nested exception is org.hibernate.hql.ast.QuerySyntaxError: unexpected token: org near lin
e 1, column 125 [select org.ein from org, billwhere
org.organizationId=bill.organizationid and bill.organizationid=?]

query i used was :
"select org.ein "+
"from SBOrganization org,SBBillingAddress bill" +
"where org.organizationId=bill.organizationid " +
"and bill.organizationid=?"

The above query was working fine when i executed the query directly in oracle database,(i entered the value in where condition eg: organizationid=482 )
however when i execute the same query in application i get the above mentioned exception.

kindly guide me to shoot this error.
thanks in advance

raj chopra
raj chopra
Ranch Hand

Joined: Apr 09, 2012
Posts: 60
problem solved.

solution was that there was a space problem before quation mark at end of the line.
Consider Paul's rocket mass heater.
subject: unexpected token
Similar Threads
Bulk Update syntax issues in hibernate
Select all row values using JPA
getting Problem in hibernate delete Query...
subquery sql to hql
HQL to get all the records in one table but in not other