• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

EJB QL Problems

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I have a simple table named PRODUCT consisting of two columns PRODUCTID and PRODUCTNAME. I have written a CMP entity bean and have deployed it on Weblogic 7. I have one finder method findByName which takes the Product Name returns a Collection. Through my client when I call the finder method it does not return any records.

The query under my EJB QL is
SELECT OBJECT(o) FROM Product AS o where o.productName = ?1

where Product is the name of the Abstract schema and is same as that of the table.

I modified the query to
SELECT OBJECT(o) FROM Product AS o where o.productName like ?1
and
SELECT OBJECT(o) FROM Product AS o where o.productName <> ?1

but still I am not getting any records.

I am able to insert records in the DB by calling the create() method on the home interface. But when I call findByPrimaryKey() method and pass the Product Id which exists in the table it gives me a SQLException saying No Data Found.

Are the queries executed by the container logged somewhere and can I see which query it is executing.

My database is MS Access.

Thanks in advance.
Jayesh.
 
Don't count your weasels before they've popped. And now for a mulberry bush related tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic