Using Java with Oracle Spatial

I am using the JDBC (Java classes dowloaded from
technet.oracle.com - (sdoapi.zip)) together with Oracle Spatial
8.1.6. I am writing a collection of Linestrings into Oracle
Spatial using the supplied java classes(sdoapi.zip). I use the
function createGeometryCollection(myCollection)to write the
Linestring collection to Oracle Spatial and they are written to
the database without error. However, when I try to read the
object back I get the following error:
Exception in thread "main"
oracle.sdoapi.geom.InvalidGeometryException
at oracle.sdoapi.adapter.AdapterSDO.importGeometry
(AdapterSDO.java:101)
at
MapInfoToOracleSpatial.MapInfoToOracleSpatial.main
(MapInfoToOracleSpatial.java:211)
I do not have a listing of this code so can you please tell me
what the error is (line of code) at line 211. Also, when I use
the Oracle Spatial Index Advisor to view the spatial data, it
only displays a quarter of the data. When I use MapInfo to view
it's equivalent TAB (Table) file it views correctly all the
data.
I can't understand why this is happening because the writing to
oracle and creation of each individual linestring does not
throw an error. It is only when I try to read back larger
objects from the database (2500 points) that it gives an error.
Is there a limitation on the size one can create linestrings?
Thanks
Regards
Stephen Syrett
Mobile Telecommunications Network
(MTN) South Africa

Latest Oracle Openworld Spatial/MapViewer activities list:
http://www.oracle.com/us/products/database/options/spatial/ssLINK/oow10-focuson-spatial-169204.pdf
thanks
LJ

Similar Messages

  • Using Toplink with Oracle Spatial (missing right parenthesis error)

    Hi,
    I always get the following error when I try to create spatial query with toplink.
    Internal Exception: java.sql.SQLException: ORA-00907: missing right parenthesis
    Any idea ? Also, there is no trace of my point in the generated sql....
    Here is the generated query:
    SELECT ID, [...]
    FROM QUEBEC_CITY
    WHERE (MDSYS.SDO_NN(GEOMETRY, JGeometry (gtype=1, dim=2, rid=8307, NULL) = 'TRUE')
    ORDER BY ID ASC
    Here is my code... :
    double[] coord = new double[]{-71.25163d, 46.8527d};
    JGeometry point = JGeometry.createPoint(coord, 2, 8307);
    SpatialOperator nearestNeighbor = SpatialOperator.nearestNeighbor(session);
    ReadAllQuery query = new ReadAllQuery(UrbanEdgeDescriptor.class);
    ExpressionBuilder eb = query.getExpressionBuilder();
    Expression geom = eb.get("geometry");
    query.setSelectionCriteria(nearestNeighbor.buildExpression(geom, point));
    query.addAscendingOrdering("id");
    List<UrbanEdgeDescriptor> results = (List)db.getSession().executeQuery(query);
    System.out.println(results!=null);

    The problem is the toString() on JGeometry. It does not print out a complete description the database can use inline. It produces:
    JGeometry (gtype=1, dim=2, rid=8307
    To get JGeometry types to work in your queries the easiest solution is to use parameter binding so the literal representation is not used.
    Doug

  • Regarding  working with oracle spatial database connections

    sir/madem,
    i am an engg student, my final year project on inserting data into oracle spatial database through java /jsp , i am working with oracle spatial database 10g/11g,
    i want know how to insert/retrive/ manuplute the spatial data into oracle spatial databse for 10g/11g, through java programing,
    the syntax for connection of oracle spatial database 10g/11g, needed,
    i have less time to finish my project
    i hope u  help me
    thank u
    kasim
    ([[email protected]|mailto:[email protected]])

    For database access from Java, you will use JDBC.
    For the specifics of the oracle spatial database, you'll have to check the documentation/forum of Oracle.
    * [How To Ask Questions The Smart Way|http://www.catb.org/~esr/faqs/smart-questions.html]
    * [JDBC Tutorial|http://java.sun.com/docs/books/tutorial/jdbc/index.html]

  • Poor performance with Oracle Spatial when spatial query invoked remotely

    Is anyone aware of any problems with Oracle Spatial (10.2.0.4 with patches 6989483 and 7003151 on Red Hat Linux 4) which might explain why a spatial query (SDO_WITHIN_DISTANCE) would perform 20 times worse when it was invoked remotely from another computer (using SQLplus) vs. invoking the very same query from the database server itself (also using SQLplus)?
    Does Oracle Spatial have any known problems with servers which use SAN disk storage? That is the primary difference between a server in which I see this poor performance and another server where the performance is fine.
    Thank you in advance for any thoughts you might share.

    OK, that's clearer.
    Are you sure it is the SQL inside the procedure that is causing the problem? To check, try extracting the SQL from inside the procedure and run it in SQLPLUS with
    set autotrace on
    set timing on
    SELECT ....If the plans and performance are the same then it may be something inside the procedure itself.
    Have you profiled the procedure? Here is an example of how to do it:
    Prompt Firstly, create PL/SQL profiler table
    @$ORACLE_HOME/rdbms/admin/proftab.sql
    Prompt Secondly, use the profiler to gather stats on execution characteristics
    DECLARE
      l_run_num PLS_INTEGER := 1;
      l_max_num PLS_INTEGER := 1;
      v_geom    mdsys.sdo_geometry := mdsys.sdo_geometry(2002,null,null,sdo_elem_info_array(1,2,1),sdo_ordinate_array(0,0,45,45,90,0,135,45,180,0,180,-45,45,-45,0,0));
    BEGIN
      dbms_output.put_line('Start Profiler Result = ' || DBMS_PROFILER.START_PROFILER(run_comment => 'PARALLEL PROFILE'));  -- The comment name can be anything: here it is related to the Parallel procedure I am testing.
      v_geom := Parallel(v_geom,10,0.05,1);  -- Put your procedure call here
      dbms_output.put_line('Stop Profiler Result = ' || DBMS_PROFILER.STOP_PROFILER );
    END;
    SHOW ERRORS
    Prompt Finally, report activity
    COLUMN runid FORMAT 99999
    COLUMN run_comment FORMAT A40
    SELECT runid || ',' || run_date || ',' || run_comment || ',' || run_total_time
      FROM plsql_profiler_runs
      ORDER BY runid;
    COLUMN runid       FORMAT 99999
    COLUMN unit_number FORMAT 99999
    COLUMN unit_type   FORMAT A20
    COLUMN unit_owner  FORMAT A20
    COLUMN text        FORMAT A100
    compute sum label 'Total_Time' of total_time on runid
    break on runid skip 1
    set linesize 200
    SELECT u.runid || ',' ||
           u.unit_name,
           d.line#,
           d.total_occur,
           d.total_time,
           text
    FROM   plsql_profiler_units u
           JOIN plsql_profiler_data d ON u.runid = d.runid
                                         AND
                                         u.unit_number = d.unit_number
           JOIN all_source als ON ( als.owner = 'CODESYS'
                                   AND als.type = u.unit_type
                                   AND als.name = u.unit_name
                                AND als.line = d.line# )
    WHERE  u.runid = (SELECT max(runid) FROM plsql_profiler_runs)
    ORDER BY d.total_time desc;Run the profiler in both environments and see if you can see where the slowdown exists.
    regards
    Simon

  • How to use Java with PL/SQL commands to send an email with attachment

    Apologizes in advance if this is the wrong place to ask the question.
    I need to use Java with PL/SQL commands to send an email with attachment. My java application runs from the command line and does some magic to gather info from an Oracle 11g db. If the DB has sendmail configured, I'd like to send the results of the data gathering as an attachment to the email addresses. I'm not sure how to do this. I've been reading up on on PL/SQL can send email with UTL_SMTP - with attachments. I'm just not sure how to translate that into being triggered by my Java application. Any suggestions or pointers on what I should read would be appreciated.
    Background - I've been programming in Java for 10+ years, but this is my first time using databases. I also have been on these forums for a long time, but lost my profile when it was switched to Oracle.
    Thanks for all help.

    user13726880 wrote:
    The original requirements were put together and given to me, an Oracle newbie. They expected the Java app to use something intrinsic to Oracle and Unix sendmail. To solve my problem, I use a JDBC connection to run some SQL commands. I take that data, format it and send the results by email to the user. By default the requirement is to send it as an HTML attachment using Unix 'sendmail'. So I do that using Runtime exec. I have also added JavaMail functionality as an alternative to sendmail. It works great and as expected.Sounds like a reasonable solution.
    Note however that PL/SQL itself can send email. And PL/SQL can call unix sendmail too.
    However myself I would have done it in java with JavaMail.

  • Webinar Replay URL: Situational Analysis at OnStar with Oracle Spatial

    A free replay is now available for the Directions webinar Situational Analysis at OnStar with Oracle Spatial, which was held on Feb. 22.
    To view the replay, visit https://www2.gotomeeting.com/register/237138906
    OnStar is the largest telematics solution provider on the globe, with 6 million subscribers in North America and abroad. OnStar uses situational awareness and real-time analysis to deliver fast, accurate emergency services to its customers. At the core of this solution is an Oracle Spatial-based analytical server that supports Google Earth visualization and NAVTEQ data. With this system, OnStar gains better understanding of customer use and behavior and better insight during emergency situations. In hurricanes, wildfires and other disasters, OnStar has developed early warning capabilities for use in near real-time. It can then manage call center resources based on anticipated call volumes and ultimately develop more effective new processes and services.
    Learn from OnStar how the company uses Oracle Spatial to deliver insight, performance and scalability.
    Key learning points include:
    * How OnStar’s Oracle Spatial analytical server supports its real-time call center Advisor application in an environment using Google Earth visualization and NAVTEQ data
    * How spatial analysis allows OnStar to obtain better insight into disaster situations, develop early warning capabilities, and improve call center coverage
    * How Oracle Database 11g (with Oracle Spatial, Real Application Clusters, Partitioning) provides scalability and performance required to process and query OnStar’s large amounts of transactional data
    Speakers include:
    * Jeff Joyner, Emergency Strategy and Outreach, GM OnStar and Injury Research Fellow, University of Michigan Program for Injury Research and Education
    * James Steiner, Vice President, Product Management, Oracle Server Technologies
    Who should attend:
    This webinar is appropriate for CIOs, business and technical managers and analysts involved in the design and management of enterprise systems where spatial analysis can add insight and value to business processes.

    Nice to have a EXPERT in this FORUM...!!
    Hi Dan, if you look at my reply I mentioned that I had loaded loc_updates.sql
    From my previous reply:
    execute loc_updates.sql which doenot update any of the rows since if you look at the syntax in loc_updates.sql file it shows update the table customers whose customer_id=344.
    Where is this customer_id=344 coming from?
    Also the datatype is a number.
    Dan, were you able to get the results as desired?
    or may be I am missing something...
    Thanks and Regards,
    Nandakishore.

  • Free Webinar - Situational Analysis at OnStar with Oracle Spatial Feb. 22

    Join us for the next Directions webinar: Situational Analysis at OnStar with Oracle Spatial
    When:  Wednesday, February 22nd, 2:00 PM - 3:00 PM EST
    Register now:  https://www2.gotomeeting.com/register/237138906
    OnStar is the largest telematics solution provider on the globe, with 6 million subscribers in North America and abroad. OnStar uses situational awareness and real-time analysis to deliver fast, accurate emergency services to its customers. At the core of this solution is an Oracle Spatial-based analytical server that supports Google Earth visualization and NAVTEQ data. With this system, OnStar gains better understanding of customer use and behavior and better insight during emergency situations. In hurricanes, wildfires and other disasters, OnStar has developed early warning capabilities for use in near real-time. It can then manage call center resources based on anticipated call volumes and ultimately develop more effective new processes and services.
    Learn from OnStar how the company uses Oracle Spatial to deliver insight, performance and scalability.
    Key learning points include:
    * How OnStar’s Oracle Spatial analytical server supports its real-time call center Advisor application in an environment using Google Earth visualization and NAVTEQ data
    * How spatial analysis allows OnStar to obtain better insight into disaster situations, develop early warning capabilities, and improve call center coverage
    * How Oracle Database 11g (with Oracle Spatial, Real Application Clusters, Partitioning) provides scalability and performance required to process and query OnStar’s large amounts of transactional data
    Speakers include:
    * Jeff Joyner, Emergency Strategy and Outreach, GM OnStar and Injury Research Fellow, University of Michigan Program for Injury Research and Education
    * James Steiner, Vice President, Product Management, Oracle Server Technologies
    Who should attend:
    This webinar is appropriate for CIOs, business and technical managers and analysts involved in the design and management of enterprise systems where spatial analysis can add insight and value to business processes.
    Register now: https://www2.gotomeeting.com/register/237138906

    Markus,
    Sorry for my late reply it had been awhile since I was here at SDN
    I did it manually in the 'old' way and at that time it did work.
    Kulvir,
    I did get it from SAPnet but when I downloaded it it contained the proper file.But I did had the same with an add-on for the business connector which only contained an empty file.
    Thanks for your answers and again sorry for my late reply back to you all

  • Using Mts With Oracle Database

    I m building Com using Visual basic.I have made them transactional using MTS.first i have firstly user Sql Server database.the components are working properly.but when i
    have made back end as Oracle the Trasactions
    fails. if i make them not Mts object then it will function properly. I have read article from microsoft site "Using Mts with Oracle".acc to them a file named XA80.dll should be on ur system on which mts is runing.I have made a database server and a client on which Mts is installed.But XA80.dll
    was not found. whats the problem .tell me solution if anyone can.
    i have installed OEM GUI which installs XA80.dll on ur system.but when i tested microsoft test program which checks weather ur Oracle supports Mts or not fails at the end. When calling XA_Open_Entry it gives error with return code -3
    Plz tell me Solution
    Thankx in advance
    null

    Hi,
    Oracle JVM in 11gR2 (the latest release) supports Java 1.5 only. So no, you won't be able to load classes compiled with target class level 1.6 into DB. But you surely may explicitly set target class level of 1.5 in javac and then load compiled classes. Or you may not use 1.6 features in your code and then CREATE JAVA SOURCE from it.

  • Starting with Oracle Spatial

    Hi, in few weeks I will have to start a new project in wich I will work with Oracle Spatial. I will like to know a good book, or any online resource to learn about this new world for me...
    Thanks a lot for your help...!!!

    Decide what version of Oracle you'll be using, then start here for documentation:
    http://www.oracle.com/technology/documentation/spatial.html
    Also Pro Oracle Spatial is essential reading:
    http://www.amazon.com/Pro-Oracle-Spatial-Euro-Beinat/dp/1590593839

  • Java with oracle ...Help needed urgently.?

    I want to store my java object into oracle .my question is how to get mapping of java with oracle object done.Please if anyone reads and knows abt it plz help me.

    Give more details.
    are you talking about java stored procedures? or using oracle as ordbms?
    version of oracle??
    In any case you can get documentation from http://otn.oracle.com
    Saifuddin

  • Problem while using XML with Oracle

    I have a problem using XML with oracle applications
    The process I am following
    1. Making a XML string.
    2. Parsing it to get a document
    3. Free the parser using xmlparser.freeparser
    4. Traversing through nodes .
    5. Freeing the document.
    The whole Process is executed in batch mode.
    The problem occurs after executing the procedure for 5000 records and I get the error
    ORA-04031: unable to allocate 4176 bytes of shared memory ("shared pool","unknown object","sga
    heap","library cache")
    Can you please help me out to overcome this problem
    It's urgent
    I have
    Oracle version 8.1.7.0.0
    XML version 1.2
    OS Windows NT
    To resolve the problem I have increase shared memory size and java initialization parameters ,which seems OK
    Looking forward for your answer.

    Hello, Reena
    Your process flow seems to be correct in term of getting/freeing memory.
    Following error
    The problem occurs after executing the procedure for 5000 records and I get the error
    ORA-04031: unable to allocate 4176 bytes of shared memory ("shared pool","unknown object","sga
    heap","library cache")may be caused by memory leaks in xdk or memory fragmentation(due to get/free memory cycle)
    To find out if this is an memory leak issue you could try to monitor V$SGASTAT from one session while running your batch process in another session.
    To prevent (or lower its impact) fragmentation issues try to PIN objects, and adjust java_pool_size and shared_pool_reserved_size.
    Anyway, counsult your Oracle DBA.
    Oracle version 8.1.7.0.0I think, you should apply database patch first of all. The latest one (8.1.7.4.x) could be accured from Metalink.

  • Server Hardware for Oracle Database 11g Release 2 with Oracle Spatial

    Hi ,
    We're to set up an Oracle Database 11g Release 2 Enterprise with Oracle Spatial.
    Can you provide me the possible Server Hardware CPU / Memory specs , number of CPUs,type of OS and teh Model, for Spatial which a million users hits the database via a webservice?
    The vendor suggested us SDD instead of HDD, any performance hike on this?
    Budget seems to okay but I think Exadata will be too dear.
    Your insights is much appreciated.Anything relating to setting up a server with spatial is greatly appreciated.
    P/S: Been a programmer and don't knwo much about server hardware specs.

    It depends.
    Seriously - before anyone can offer anything but generalities here you need to really define exactly what you expect the database to deliver.
    In general however, I will throw out these questions and ideas...
    For instance - you say a million users "hit" the database (via a web service). Is that WFS, WMS, KML or ???
    Over - how long? A year? A month? A minute? A million hits over a year spread out evenly is only about 2 per minute.
    And what is a hit? A single random record? Or about 10,000 records in the same spatial area... or? And for each record - are you returning simple point data - or hugely complex polygons with thousands of vertexes each?
    How does this software work? Is it custom - or is it well known? Does it really query the database for every map (I assume it is a map service) feature - or does it read an area once and cache it in the middle tier? Or does it do something really smart and use cached tiles for static data - overlayed with vectors for dynamic data?
    And although you say Oracle Spatial - are you really using Spatial - or just Locator functions (less processing in general)? And if spatial - are you doing raster in the db - or 3D analysis - or other special functionality?
    SSD vs. HDD. - If you can buy a server with more RAM than the data set size (pretty easy these days) - and you do mostly reads (almost always the case for a map app) - buy a small cheap array of RAID'd HDD's - internal to the server is fine. Once the data is read into RAM - the HDD's do basically nothing.
    Server CPU and memory. Amount - see above. CPU Speed (use performance benchmarks - not GHz numbers) AND memory speed (often overlooked) - buy as fast as possible. Why? You pay for licenses by the core (2 cores per license for x64). And HW is MUCH MUCH MUCH cheaper than Oracle licenses. Plan to upgrade HW every year if necessary to avoid buying more licenses (sounds crazy - but it is much cheaper).
    This may seem like a lot - but these questions are just the tip of the iceberg. I have been in charge of spec'ing, building, and programming spatial systems now for about 20 years, so I have a pretty good idea of how to do enterprise scale computing on a Ramon-noodle budget.
    Smart clean software is your friend - don't ask the HW to do anything unless absolutely necessary (cache results and reuse as much as possible), and you can get crazy performance from minimal hardware.
    Bryan

  • Error when trying to use LogMiner with Oracle 8.1.6.0.0

    Hi everybody,
    I'm trying to use LogMiner with Oracle 8.1.6.0.0. When I execute the following code with SQL*Plus, I have an error.
    BEGIN
    DBMS_LOGMNR.START_LOGMNR
    (options =>
    dbms_logmnr.dict_from_online_catalog);
    END;
    The error displayed by SQL*Plus is:
    PLS-00302: 'DICT_FROM_ONLINE_CATALOG' must be declared.
    Please, how to solve this problem?
    Thanks you in advance for your answers.

    user639304 wrote:
    Hi everybody,
    I'm trying to use LogMiner with Oracle 8.1.6.0.0. When I execute the following code with SQL*Plus, I have an error.
    BEGIN
    DBMS_LOGMNR.START_LOGMNR
    (options =>
    dbms_logmnr.dict_from_online_catalog);
    END;
    The error displayed by SQL*Plus is:
    PLS-00302: 'DICT_FROM_ONLINE_CATALOG' must be declared.
    Please, how to solve this problem?
    Thanks you in advance for your answers.Looking at the 8.1.7 doc set (the oldest available on tahiti) I get no hits when searching for 'dict_from_online_catalog'. Searching the 9.2 doc set turns up a reference. Looks like you are trying to use an option that isn't available in your version of Oracle.

  • How to read azure storage data using JAVA with REST API

    Hi,
    We have a cloud service in our lab. We have enabled diagnostics
    in cloud services. So WADPerformanceCounterTable was created in storage account. Now , We want to read the WADPerformanceTable using
    JAVA with REST API. Is there any way to collect these details. please give me any
    sample code to connect azure storage using table service REST API.
    Thanks & Regards
    Rathidevi

    Hi,
    Please have a look at this article:
    https://convective.wordpress.com/2010/08/18/examples-of-the-windows-azure-storage-services-rest-api/, it demonstrate how to use table service Rest API, it also give us the code, hope this helps. Of course, the
    MSDN article could also help us coding.
    Best Regards,
    Jambor
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Using Tuxedo with Oracle Real Application Clusters (RAC)

    Hi all ,
    Our present Producation environment is Tuxedo8.0 with Oracle 9i as database .
    We are planning to implement oracle RAC .
    Can any one tell us , with the current tuxedo version which is 8.0 ,can we for RAC Or we need to upgrade Tuxedo to 9.1 for RAC Implementation?
    If anyone has Implemented Tuxedo and Oracle with RAC successfully
    Pls share your experience.
    Thanks In Adavance
    Nadeer .

    Subbu,
    As I mentioned earlier in this thread, support for Oracle RAC has been
    implemented in Tuxedo 9.1 and in the Tuxedo 8.1 and Tuxedo 9.0 rolling patch
    streams. There are no plans to backport this feature to Tuxedo 8.0. If you
    plan to use RAC transactionally and if it is possible for multiple services
    that could be located on different RAC instances to be accessed in a single
    transaction (which will be true for most applications), then you should
    upgrade to a version of Tuxedo with support for Oracle RAC. The
    documentation at http://e-docs.bea.com/tuxedo/tux91/ads/adorac.htm#248431
    gives an overview of RAC support in Tuxedo.
    Ed
    <Subramonian Arumugom> wrote in message news:[email protected]..
    Hello Nadeer, Hello Ed,
    Has the implementation of Tuxedo8.0 with Oracle RAC was completed
    successfully ?.
    If it is done , I have few doubts. Could you please help me ?.
    1) I hope your Tuxedo middleware connects to the oracle Database using
    Oracle XA resource manager and the TMS server built using buildtms with
    oracle as RM .As per the mail from Ed, migration of Tuxedo9.1 should be done
    before moving to Oracle RAC.
    Also from BEA documentation, Oracle RAC support was given as new feature in
    Tuxedo9.1.
    Our Application uses Oracle RM to connect to Oracle DB[ Oracle 10g] from
    Tuxedo8.0. So do we need to upgrade to Tuxedo9.1. for using Oracle RAC ?.
    Thanks for your help
    Best Regards
    Subbu
    #9880278452
    Edited by subramonian.a at 04/16/2007 12:15 AM
    Edited by subramonian.a at 04/16/2007 12:19 AM
    Edited by subramonian.a at 04/16/2007 1:37 AM
    Edited by subramonian.a at 04/16/2007 8:20 AM

Maybe you are looking for

  • Session Usage

    Hi All, I have been assigned a job for an exsisting application where one of the problem is to make the proper usage of HTTPSession. I guess there has been a session leakage .i.e. Session are not invalidated properly when the user log outs of the app

  • Lost Pictures on iPhoto

    I tried to open iPhoto & saw that all 1,000 of my pictures were gone. I was able to see that they are still on the computer in the iPhoto folder but only available when I open the Preview application. I want to put the pictures back in iPhoto but it

  • API's for Communnication Suite

    Hi, Where can find the list of APIs and its description for Communication Suite (Messaging, Calender and IM). I want to develop my own GUI for Creations of Users groups, and all other things we do using DA. Regards, Sambhaji

  • Add Printer.

    Hi, I have some simple queries as below, - How do i install a printer in SAP ? - Do i have to do any changes in the local windows user printer name or settings for the printing to work from SAP ? - Is the printer setup in SAP common for all printers,

  • Visual Composer - access Web Services using http proxy

    Hi, I want to use an external web service in the Visual Composer. I set up the service in NWA -> SOA Management -> Destination Template Management. I defined the http proxy in System Global Settings. The proxy requires authentication so I provided us