• 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
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Dynamic EJB QL

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I wonder if someone can help me. I am querying an oracle database using the following EJB QL, SELECT OBJECT(e)FROM ReStores e WHERE "e.leases.expirationDate = '06-30-2006' which is built dynamically
On execution I get the following message: java.sql.SQLException : ORA-01843: Not a valid month.
The object being passed is a SimpleDateFormat type and I have formatted in various forms such as MM-dd-yyyy etc but still get the same error.
I am new to EJB QL and Java as a whole.
Thanks for your help.
Leonard
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It would probably be easier to pass in the date as a parameter. If you're using a constant/literal value for the date, it has to be the number of seconds since 01/01/1970 at 00:00:00 GMT (just like System.currentTimeMillis() returns time in "milliseconds since...").
 
Lasse Koskela
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Could you copy-paste all the EJB-QL's you have tried?
And be careful, the statement you have posted so farhad a typo (the quotes before e.leases)...
 
Lasse Koskela
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Tryinstead of
[ October 15, 2003: Message edited by: Lasse Koskela ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic