Home > java, oracle > Oracle Number to Java Object

Oracle Number to Java Object

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 :

Advertisements
Categories: java, oracle Tags: ,
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: