[jboss-user] [EJB 3.0] - error in your SQL syntax

albtorres do-not-reply at jboss.com
Mon Jun 11 04:53:57 EDT 2007


Hello,

I,am trying to execute a query in a stateless bean, with jboss seam

The query is

List existing = em.createQuery("select username from Users")
        .getResultList();

and I get this error

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 '.users users0_' at line 1

My entity bean is defined as

@Entity
@Name ("users")
@Scope (SESSION)
@Table(name = "users")
public class Users implements java.io.Serializable {
	
	private static final long serialVersionUID = 1881413500711441951L;
	
	private String username;
	private String password;
                .........

What is wrong?? 
I have configue my app with jboss seam
seam setup
seam new-project

My database is mysql 4.1.21 and if I connect by jdbc all its ok.

thank you

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4053005#4053005

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4053005



More information about the jboss-user mailing list