-->
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: Again the Date and Time Problem
PostPosted: Sat Feb 02, 2008 1:43 am 
Newbie

Joined: Tue Jan 22, 2008 9:53 am
Posts: 18
Hi ppl !

This is a old issue but i couldn't solve yet. I'm using Hibernate 3 and connecting to an Oracle version 8i.
Now the problem: I have a DATE type field. (Not TIMESTAMP, this type doesn't exist in this version)
I'm trying to map this field to an java.util.Date class. But it only retrieves the date and ignore the time part when i map it using the type="date".
If I use the type="time" it retrieves only the time and but this time i don't have the date.
Mapping with a type="timestamp" i got an exception. And if i don't define any type i get an exception: "time stamp expected".
Mapping to a calendar java type and a java.sql.Date was unsuccesful too.
I used in my experiments the ojdbc14.jar driver version 8 and 10.
I can't update or change the version of the Oracle server. And i don't think i have to create a user defined type to map a so usual field type.
Have anybody solved this issue before? Please i need some light on it.

Thanks in advance


Top
 Profile  
 
 Post subject: Re: Again the Date and Time Problem
PostPosted: Sat Feb 02, 2008 6:28 am 
Newbie

Joined: Fri Jan 25, 2008 8:32 am
Posts: 15
you should remove type. type is not required.
thiagodf wrote:
Hi ppl !

This is a old issue but i couldn't solve yet. I'm using Hibernate 3 and connecting to an Oracle version 8i.
Now the problem: I have a DATE type field. (Not TIMESTAMP, this type doesn't exist in this version)
I'm trying to map this field to an java.util.Date class. But it only retrieves the date and ignore the time part when i map it using the type="date".
If I use the type="time" it retrieves only the time and but this time i don't have the date.
Mapping with a type="timestamp" i got an exception. And if i don't define any type i get an exception: "time stamp expected".
Mapping to a calendar java type and a java.sql.Date was unsuccesful too.
I used in my experiments the ojdbc14.jar driver version 8 and 10.
I can't update or change the version of the Oracle server. And i don't think i have to create a user defined type to map a so usual field type.
Have anybody solved this issue before? Please i need some light on it.

Thanks in advance


Top
 Profile  
 
 Post subject: This solution didn't work for me
PostPosted: Sat Feb 02, 2008 10:20 am 
Newbie

Joined: Tue Jan 22, 2008 9:53 am
Posts: 18
Yeah, as i said I have read about don't mentioning the type. But it's not working for me. When i don't put the type i get an "Exception: timestamp expected for column ..."
When you don't put a especific type, hibernate chooses the best type for you. But in my case, hibernate is choosing the timestamp type which is incompatible with the DATE type field in Oracle 8i. I know this works for Oracle 9i and more recent versions.

I hope somebody have a solution for this problem, but thanks for giving your suggestion


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.