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

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
B: MDSYS.SDO_GEOMETRY
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
    queryObject(conn);


    conn.close();

    STRUCT dbObject = (STRUCT) ors.getObject(2);
    System.out.println(Adapters.structToWkt(dbObject));

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

Chris
Previous Topic: getting startet with SDOAPI
Next Topic: AutoDesk Map text to Oracle - 911
Goto Forum:
  


Current Time: Wed Apr 23 19:19:14 CDT 2014

Total time taken to generate the page: 0.13353 seconds