-->
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.  [ 5 posts ] 
Author Message
 Post subject: Query Problem with MySql
PostPosted: Tue Nov 01, 2005 11:07 am 
Newbie

Joined: Mon Mar 28, 2005 7:40 am
Posts: 5
Hi

I want to do a simple query but i get an error:

The query is this:
getHibernateTemplate().find("from Users");

but i get this error:
java.sql.SQLException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'from' at line 1

Im using Mysql 5 whith Hibernate 2.1.3

Thankou!!!!!


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 01, 2005 11:12 am 
Senior
Senior

Joined: Thu Aug 04, 2005 4:54 am
Posts: 153
Location: Birmingham, UK
Users is a reserved word. Quote it or change it.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 01, 2005 11:15 am 
Newbie

Joined: Mon Mar 28, 2005 7:40 am
Posts: 5
Soryy.. i put "Users" for example.
The original table name is "Movies"

Thankyou!


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 01, 2005 11:40 am 
Newbie

Joined: Tue Nov 01, 2005 11:39 am
Posts: 4
I'm a newbie like you but I think you need the Class Name which is mapped with your Movies table.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 01, 2005 11:44 am 
Senior
Senior

Joined: Thu Aug 04, 2005 4:54 am
Posts: 153
Location: Birmingham, UK
Post the SQL that is output, without that we're forced to guess.


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

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.