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: getting startet with SDOAPI
Next Topic: AutoDesk Map text to Oracle - 911
Goto Forum:

Current Time: Tue May 30 18:22:17 CDT 2023