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: Java appl receives DECIMAL when expecting Oracle NUMBER
PostPosted: Mon Feb 01, 2010 7:51 am 
Newbie

Joined: Mon Feb 01, 2010 7:37 am
Posts: 2
Hi all,

The problem is this: Oracle tables with NUMBER datatype columns are migrated into DB2 as DECIMAL.

BUT

The Java application (Eclipse and Weblogic) processing the db data expects an integer value from DB2 but receives a decimal datatype instead, which causes the application malfunction.

Is there a way (if any) to workaround this problem, so that the Java application receives an integer from DB2 that can process the way it has been doing all along with Oracle?

EXAMPLE
=======

SELECT IN ORACLE
================================================
SQL> select id_parametro from gims.tm_parametro;

ID_PARAMETRO
1
2
3
4
6

SQL>

SAME SELECT IN DB2
================================================
$ db2 select id_parametro from gims.tm_parametro

ID_PARAMETRO
1.
2.
3.
4.
6.

But the java application expects integer values such as 1 2 3 4 5 not decimals like 1. or 1.0 etcetera

How can we fix this ?? Is there a configuration file in which we could map datatypes between DB2 and Java? I have thought of revenge.xml but need confirmation since I'm not a Java expert.

Thanks in advance,

Raul Baron


Top
 Profile  
 
 Post subject: Re: Java appl receives DECIMAL when expecting Oracle NUMBER
PostPosted: Mon Feb 01, 2010 11:26 am 
Beginner
Beginner

Joined: Fri Jan 23, 2009 10:34 am
Posts: 25
Location: Switzerland
True, reveng.xml is your solution. Please have a look to https://www.hibernate.org/hib_docs/tool ... ering.html : the <type-mapping> tag is what you are looking for.


Top
 Profile  
 
 Post subject: Re: Java appl receives DECIMAL when expecting Oracle NUMBER
PostPosted: Tue Feb 02, 2010 3:23 am 
Newbie

Joined: Mon Feb 01, 2010 7:37 am
Posts: 2
OK Jkronegg. Thank you very much. This gives me a precious reference.

Thanks again for your help

BRGDS,

Raul Baron


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.