Archive

Posts Tagged ‘oracle data type’

Oracle Number to Java Object

January 19, 2010 Leave a comment

Recently i needed to know what should be the JAVA Object to use when mapping against an oracle database.

You can easily find alot of documentation on these mappings by searching google, but if you need to convert data types in the form of Number(p,s) (where p is precision and s is scale) you will have alot more trouble.

I ended up finding a reference to some old bea documentation(which got thrown offline when oracle took over bea) in an objectmix thread. So i put it here if anyone ever needs it:

Column Definition Returned by getObject()
NUMBER(P <=3D 9)
Integer

NUMBER(P <=3D 18)
Long

NUMBER(P >=3D 19)
BigDecimal

NUMBER(P <=3D16, S > 0)
Double

NUMBER(P >=3D 17, S > 0)
BigDecimal

Links :

Categories: java, oracle Tags: ,