I'm sorry but it's been quite a long time since I worked on this, 
expecially on the Oracle side, so I can't 100% garantee what I'm saying...

Anyway a NUMBER column with no precision/scale in Oracle correspond to a 
38 digit number with variable precision, see:
http://download.oracle.com/docs/cd/B28359_01/server.111/b28318/datatype.htm#CNCPT1832

So I think only a Java BigDecimal is adequate to reliably store it, but 
I may be wrong...

These are the relevant type mappings that the SISDB plugin uses for 
Oracle (first number is precision, second number is scale):

java.sql.Types.TINYINT  <= "NUMBER",3,0
java.sql.Types.BIGINT   <= "NUMBER",38,0
java.sql.Types.NUMERIC  <= "NUMBER",0,0
java.sql.Types.DECIMAL  <= "NUMBER",0,0
java.sql.Types.INTEGER  <= "NUMBER",10,0
java.sql.Types.SMALLINT <= "NUMBER",5,0
java.sql.Types.FLOAT    <= "FLOAT",8,8
java.sql.Types.REAL     <= "FLOAT",8,8
java.sql.Types.DOUBLE   <= "DOUBLE PRECISION",16,16

As you can see a NUMBER column is mapped to the Java SQL NUMERIC or 
DECIMAL type. Where exactly then a BigDecimal instance is created is 
beyond my memory, maybe by the JDBC driver itself, however I think it is 
required to store a 38 digit number no loss of precision.

Anyway your NUMBER column name of "county_id" makes me think it's a 
simple integer identifier of some sort, so NUMBER is not a good type for 
it. Use NUMBER(10,0) for a 10 digit integer number, that will be mapped 
to a Java Integer.

Bye
Paolo


> any suggestions?
> 
> -------- Original Message --------
> Subject:      [jump-pilot - OpenJUMP Functions Problems] BigDecimal to 
> Double class cat exception
> Date:         Wed, 20 May 2009 16:30:16 +0000
> From:         SourceForge.net <nore...@sourceforge.net>
> To:   nore...@sourceforge.net
> 
> 
> 
> Read and respond to this message at: 
> https://sourceforge.net/forum/message.php?msg_id=7401466
> By: spatial1234
> 
> I am using SIS DB plugin to query the data from oracle database. One of my 
> table
> column is number datatype.
> When I try to save as shpafile it's giving me following exception. Does 
> anybody
> has fix for it?
> 
> Here my oracle table structure
> 
> create table county
> (county_id  NUMBER,
>  geom       mdsys.sdo_Geometry);
> 
> java.lang.ClassCastException: java.math.BigDecimal cannot be cast
> to java.lang.Double
>       at 
> com.vividsolutions.jump.io.ShapefileWriter.writeDbf(ShapefileWriter.java:436
> )
>       at 
> com.vividsolutions.jump.io.ShapefileWriter.write(ShapefileWriter.java:288)
>       at 
> com.vividsolutions.jump.io.datasource.ReaderWriterFileDataSource$1.executeUp
> date(ReaderWriterFileDataSource.java:72)
>       at 
> com.vividsolutions.jump.workbench.datasource.AbstractSaveDatasetAsPlugIn.run
> (AbstractSaveDatasetAsPlugIn.java:33)
>       at 
> com.vividsolutions.jump.workbench.ui.task.TaskMonitorManager$TaskWrapper.run
> (TaskMonitorManager.java:149)
>       at java.lang.Thread.run(Unknown Source)
> 
> Thanks,
> Bala
> 
> ______________________________________________________________________
> You are receiving this email because you elected to monitor this forum.
> To stop monitoring this forum, login to SourceForge.net and visit: 
> https://sourceforge.net/forum/unmonitor.php?forum_id=729479
> 
> 
> 
> ------------------------------------------------------------------------------
> Crystal Reports - New Free Runtime and 30 Day Trial
> Check out the new simplified licensing option that enables 
> unlimited royalty-free distribution of the report engine 
> for externally facing server and web deployment. 
> http://p.sf.net/sfu/businessobjects
> _______________________________________________
> Jump-pilot-devel mailing list
> Jump-pilot-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel


------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, & 
iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian
Group, R/GA, & Big Spaceship. http://www.creativitycat.com 
_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

Reply via email to