• 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

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 ]
 
We begin by testing your absorbancy by exposing you to this 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