getting : org.apache.derby.client.am.SqlException

Hi,

I am writing a small appl. where I am using EJB 3.0 with Java Persistence API. If I execute the sample programs in Java EE tutorials, then the programs work fine. But, when I try to run the sample application I get the error below. I am using the following named query.

@NamedQuery(name = "Book.findAll", query = "SELECT b FROM Books b").

=======================================================

Internal Exception: org.apache.derby.client.am.SqlException: Column 'BOOKID' is either not in any table in the FROM list or appears within a join specification and is outside the scope of the join specification or appears in a HAVING clause and is not in the GROUP BY list. If this is a CREATE or ALTER TABLE statement then 'BOOKID' is not a column in the target table.Error Code: -1

Call:SELECT bookid, author, price, title, inventory, catagory FROM BOOKS WHERE (catagory = CAST (? AS VARCHAR(32672) ))

bind => [Technical]

Query:ReportQuery(cart.Books)

at oracle.toplink.essentials.exceptions.DatabaseException.sqlException(DatabaseException.java:303)

at oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:551)

at oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:437)

at oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.executeCall(UnitOfWorkImpl.java:1355)

at oracle.toplink.essentials.internal.queryframework.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:213)

at oracle.toplink.essentials.internal.queryframework.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:199)

at oracle.toplink.essentials.internal.queryframework.DatasourceCallQueryMechanism.executeSelectCall(DatasourceCallQueryMechanism.java:270)

at oracle.toplink.essentials.internal.queryframework.DatasourceCallQueryMechanism.selectAllRows(DatasourceCallQueryMechanism.java:600)

at oracle.toplink.essentials.internal.queryframework.ExpressionQueryMechanism.selectAllRowsFromTable(ExpressionQueryMechanism.java:2108)

at oracle.toplink.essentials.internal.queryframework.ExpressionQueryMechanism.selectAllReportQueryRows(ExpressionQueryMechanism.java:2074)

at

[2315 byte] By [pantulaa] at [2007-11-27 9:05:16]
# 1
Call:SELECT bookid, author, price, title, inventory, catagory FROM BOOKS The select run external ?
Solraca at 2007-7-12 21:39:18 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...