-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: hibernate exception : in expected
PostPosted: Tue Oct 03, 2006 8:43 am 
Newbie

Joined: Tue Oct 03, 2006 8:36 am
Posts: 3
I am new to hibernate and while working on the following program i am getting the
"in expected: item [SELECT item.item_id,item.purchase_id,item.serial from items item]' exception.

try
{
// This step will read hibernate.cfg.xml and prepare hibernate for use
SessionFactory sessionFactory = new Configuration().configure().buildSessionFactory();
session =sessionFactory.openSession();

//Create Select Clause HQL
String SQL_QUERY ="SELECT item.item_id,item.purchase_id,item.serial from items item";
Query query = session.createQuery(SQL_QUERY);
for(Iterator it=query.iterate();it.hasNext();){
Object[] row = (Object[]) it.next();
System.out.println("ID: " + row[0]);
System.out.println("Name: " + row[1]);
System.out.println("Amount: " + row[2]);
}
session.close();
}catch(Exception e)
{
System.out.println(e.getMessage());
}
finally
{
}

I chked it and know tht the query is correct but i am getting the same problem again. can anyone help me?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.