-->
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.  [ 2 posts ] 
Author Message
 Post subject: Oracle dialect
PostPosted: Mon Dec 20, 2004 9:22 am 
Newbie

Joined: Mon Dec 20, 2004 9:02 am
Posts: 1
Hello ,

i use hib2
i set my dialect to oracle dialect
i use oracle 9i

i just strated using hibernate and i was reading the dialect stuff.
then i met a problem and want to ask you this:

i have the following snippet , in that snippet i formatted the date string to

conform to oracle date format.
--------------------------------------------------------------

Date nextdate= new Date(kayittarih.getTime());
Date prevday= new Date(kayittarih.getTime());

SimpleDateFormat fmt = new SimpleDateFormat("dd-MMM-yy");

return getHibernateTemplate().find("from Evrak u"
+ " where " + QUERY_IS_ACTIVE +
" and u.createtime < '" +fmt.format(prevdate)+"'"+
" and u.createtime > '" +fmt.format(nextday)+"'" );
------------------------------------------------------------------------------------

what are the alternatives that fits best to my desire to get rid of that kind of coding formatting?

and some questions :

-is it rational to configure oracle ? what if i port my application to another oracle server--i will have to configure every time.

--isn't it an issue that Oracle dialect should handle? (if i understand the concept of diaelect correctly)

Thank you,,


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 20, 2004 11:29 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
use paramter placeholders instead of string concatenation.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.