Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » JBoss User Help »

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

scott.stark@jboss.org

2007-06-11


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
_______________________________________________
jboss-user mailing list
jboss-user@(protected)
https://lists.jboss.org/mailman/listinfo/jboss-user
©2008 junlu.com - Jax Systems, LLC, U.S.A.