-->
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.  [ 8 posts ] 
Author Message
 Post subject: How use 'datetime' type in oracle?
PostPosted: Tue Apr 24, 2007 4:01 am 
Newbie

Joined: Tue Apr 03, 2007 5:42 am
Posts: 13
if hibernate mapping type is 'date', then oralce save as 'yyyy-MM-dd'
if hiberneate mapping type is 'time' then oracle save as 'hh:mm:ss'

i want to save as 'yyyy-mm-dd hh:mm:ss' by java.util.Date

please, solve this problem.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 24, 2007 4:16 am 
Regular
Regular

Joined: Mon Mar 26, 2007 12:38 am
Posts: 119
Use timestamp

-----------------------------------
Rate the reply if you find it helpful


Top
 Profile  
 
 Post subject: oracle don't support timestamp.
PostPosted: Tue Apr 24, 2007 4:46 am 
Newbie

Joined: Tue Apr 03, 2007 5:42 am
Posts: 13
sorry, oracle don't support timestamp.
and, also,, i want to use the type by logic.

pramodkp wrote:
Use timestamp

-----------------------------------
Rate the reply if you find it helpful


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 24, 2007 4:55 am 
Regular
Regular

Joined: Mon Mar 26, 2007 12:38 am
Posts: 119
Hey,
you read me wrong. ( or I don't get your requirement correctly )
use "date" on oracle which always stores the time part too.
use 'timestamp' as the hibernate mapping type.
use util.Date in the model.

----------------------------------------
Rate the reply if you find it helpful


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 24, 2007 5:34 am 
Newbie

Joined: Tue Apr 03, 2007 5:42 am
Posts: 13
thanks, your help.

my junit was passed. thanks!!
but, i can't passed at resin web aplication.(resion 3.15 ver.)
messege is
Code:
org.hibernate.HibernateException: Wrong column type: RCT_CREATED_DATE,
expected: timestamp

may i have your favor, again? TT-TT;;


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 24, 2007 8:06 am 
Newbie

Joined: Tue Apr 03, 2007 5:42 am
Posts: 13
very thanks pramodkp^^

i can solve the problem by change 'connection.driver_class' hibernate property.


before :
org.hibernate.dialect.Oracle9Dialect

after:
oracle.jdbc.driver.OracleDriver

but, my database is 9i release2.
is it hibernate's bug??

anyway, thanks your interest.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 24, 2007 8:19 am 
Regular
Regular

Joined: Mon Mar 26, 2007 12:38 am
Posts: 119
Hi,

>>>>i can solve the problem by change 'connection.driver_class' hibernate property.
before :
org.hibernate.dialect.Oracle9Dialect
after:
oracle.jdbc.driver.OracleDriver


Again, I am not getting things correctly.
How could it establish a jdbc connection if it was specified wrongly ? ( Oracle9iDialect )
I expect an Exception !!!


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 24, 2007 9:50 am 
Newbie

Joined: Tue Apr 03, 2007 5:42 am
Posts: 13
hub;;;
sorry,

it's copy misstake.

before:
org.hibernate.dialect.Oracle9Dialect

after:
org.hibernate.dialect.OracleDialect


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