Home » Server Options » Spatial » Java error with oracle.spatial.*
Java error with oracle.spatial.* [message #92641] Thu, 04 November 2004 01:58
Messages: 128
Registered: November 1998
Senior Member

I downloaded SDOAPI (http://www.oracle.com/technology/software/products/spatial/files/sdo_java_040319.zip) and the samplefiles (filedate: 2000-05-05) from the Oracle Website. Now I tried to use it on Ocacle 9.1 and got some errors.

Database connection is working, my program is able to retrieve data form the database. But when using the oracle.spatial.util.Adapters an error occurs:

Exporting to WKT...
Geometry #1
Exception in thread "main" java.lang.ExceptionInInitializerError: java.lang.NullPointerException
        at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java(Compiled Code))
        at java.sql.DriverManager.getConnection(DriverManager.java(Compiled Code))
        at java.sql.DriverManager.getConnection(DriverManager.java:216)
        at oracle.spatial.util.Adapters.<clinit>(Adapters.java:47)
        at SampleSDOtoWKT.queryObject(SampleSDOtoWKT.java(Compiled Code))
        at SampleSDOtoWKT.main(SampleSDOtoWKT.java:47)

Code that caused the error:

    OracleConnection conn = (OracleConnection)...

    // Query for SDO_GEOMETRY object


    STRUCT dbObject = (STRUCT) ors.getObject(2);

Is it possible that the samplefiles do not fit the SDOAPI version provided on the Oracle website?

Can someone give me an example how to use the Adapters.structToWkt() method of oracle.spatial.util.Adapters-class from SDOAPI? Or just a simple java-program working with this version of SDOAPI.

Thanks very much

Previous Topic: Oracle Forms and Map
Next Topic: Spatial Extractor for Oracle Spatial
Goto Forum:

Current Time: Tue Aug 22 19:41:51 CDT 2017

Total time taken to generate the page: 0.02785 seconds