-->
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: some Bug In hibernate3's date field to oracle!!!!!
PostPosted: Thu Aug 25, 2005 3:08 am 
Regular
Regular

Joined: Tue Dec 30, 2003 2:35 am
Posts: 85
Hi:
i write some hibernate3 program,i write the date field to oralce of windows2000 ad server,it work ok,but when i use the same code to oracle8.1.5 of aix4.3,the hibernate3 tell me some error:datatype error!!!
here is my code:
hbm.xml
Code:
.....
<property name="yhbgabtime" column="YHBGABTIME" type="java.sql.Timestamp"  not-null="true" />
.....


POJOs
Code:
   /**
     * Return the value of the YHBGABTIME column.
     * @return java.util.Date
     */
    public java.sql.Timestamp getYhbgabtime()
    {
        return this.yhbgabtime;
    }

    /**
     * Set the value of the YHBGABTIME column.
     * @param date
     */
    public void setYhbgabtime(java.sql.Timestamp date)
    {
        this.yhbgabtime = date;
    }


in my application java code:
Code:
....
Jbxx objJbxx = new objJbxx();
.....
ParsePosition pos = new ParsePosition(0);
SimpleDateFormat bartDateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
Date objTest = bartDateFormat.parse(sSendTime, pos);
java.sql.Timestamp dateTime = new java.sql.Timestamp(objTest.getTime());//Timestamp
objJbxx.setYhbgabtime(dateTime);
sesson.save(objJbxx);
.......

Maybe,this question is because of some oracle instance setting,
In My Oracle8.1.7 the code runs ok!(oracle8.1.7,32Bit,windows2000ADserver)
here is some oracle instance parameter!
Code:
NLS_CALENDAR GREGORIAN
NLS_CHARACTERSET ZHS16GBK
NLS_COMP BINARY
NLS_CURRENCY $
NLS_DATE_FORMAT DD-MON-RR
NLS_DATE_LANGUAGE AMERICAN
NLS_DUAL_CURRENCY $
NLS_ISO_CURRENCY AMERICA
NLS_LANGUAGE AMERICAN
NLS_NCHAR_CHARACTERSET ZHS16GBK
NLS_NUMERIC_CHARACTERS .,
NLS_RDBMS_VERSION 8.1.7.0.0
NLS_SORT BINARY
NLS_TERRITORY AMERICA
NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM
NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZH:TZM
NLS_TIME_FORMAT HH.MI.SSXFF AM
NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZH:TZM


here is some oracle instance parameter(oracle8.1.5 64bit,Unix-->aix4.3)
Code:
NLS_CALENDAR GREGORIAN
NLS_CHARACTERSET ZHS16GBK
NLS_COMP   
NLS_CURRENCY $
NLS_DATE_FORMAT DD-MON-LL
NLS_DATE_LANGUAGE AMERICAN
NLS_DUAL_CURRENCY $
NLS_ISO_CURRENCY AMERICA
NLS_LANGUAGE AMERICAN
NLS_NCHAR_CHARACTERSET ZHS16GBK
NLS_NUMERIC_CHARACTERS .,
NLS_RDBMS_VERSION 8.1.5.0.0
NLS_SORT BINARY
NLS_TERRITORY AMERICA
NLS_TIMESTAMP_FORMAT DD-MON-LL HH.MI.SSXFF AM
NLS_TIMESTAMP_TZ_FORMAT DD-MON-LL HH.MI.SSXFF AM TZH:T
NLS_TIME_FORMAT HH.MI.SSXFF AM
NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZH:TZM


i think the time or timestamp parameter of oracle is the main question!but after i adjust all parameter oracle of aix,the error still happen(hibernate3 tell me:datatype error)!!!

some one who can help me?
if i use date variable(not timestamp),the oracle of nt and the oracle of aix both run ok!but the date variable can not remember the hour,can not remember minute,can not remember second info!so the java.sql.timestamp is my only choose!

thanks for you help!


Top
 Profile  
 
 Post subject: playgroung
PostPosted: Fri Aug 26, 2005 12:23 pm 
Expert
Expert

Joined: Fri Jul 22, 2005 2:42 pm
Posts: 670
Location: Seattle, WA
I think you may need to play with JDBC driver versions:
http://www.oracle.com/technology/tech/j ... bc_faq.htm

And may need to adjust dialect (take a glance at OracleDialect and Oracle9Dialect for inspirations )

Some combination should work :)

_________________
--------------
Konstantin

SourceLabs - dependable OpenSource systems


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.