-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Need help DB2 vs Oracle
PostPosted: Mon Jul 03, 2006 12:33 pm 
Newbie

Joined: Mon Jul 03, 2006 12:26 pm
Posts: 2
Hi,

i am new to Hibernate query language. Actually we are migrating an Hibernate+ DB2 application to Hibernate + Oracle application.

In one of my java class we have following code.

try {
outages = (List) session.find(
" from Outage as o where o.warningBegin < CURRENT TIMESTAMP " +
" and o.outageEnd > CURRENT TIMESTAMP and o.application = 'ALL' " +
" or o.application = ?", appName, Hibernate.STRING);
System.out.println("Outage findNextByApplication outages size" + outages.size());
} catch( HibernateException e ) {
log.error("Exception thrown while searching for outages.");
log.info("Exception:", e);
}

The above code is working fine with DB2 database but I am hitting " Exception thrown while searching for outages" exception when I tried with Oracle database.

Could any one please help me out. Do i need to change my query to get it work in oracle. any suggestions please.

Thanks and regards.

nadipalli


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 04, 2006 2:52 am 
Pro
Pro

Joined: Mon Jan 24, 2005 5:39 am
Posts: 216
Location: Germany
Can you show us the stacktrace ?

_________________
dont forget to rate !


Top
 Profile  
 
 Post subject: thanks for reply
PostPosted: Tue Jul 04, 2006 7:15 pm 
Newbie

Joined: Mon Jul 03, 2006 12:26 pm
Posts: 2
hi,

Thanks for your reply, it was working after changing the "CURRENT TIMESTAMP " to CURRENT_TIMESTAMP . it seems in oracle we have to use CURRENT_TIMESTAMP .

Regards.

Nadipalli


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.