Thread Subject: Database insert java/oracle object directly

Subject: Database insert java/oracle object directly

From: Sven

Date: 18 Jan, 2010 20:37:04

Message: 1 of 2

Hi all,

I have the database toolbox, and I connect to an oracle database. When I query/fetch from my table, I get an oracle.sql.STRUCT object returned (this is the correct behaviour - I'm fetching oracle SDO_GEOMETRY). What I want to do, is to somehow *use that struct* (which I think is a java object) in an oracle INSERT.

Ie,

>> curs = exec(conn,'SELECT mygeom FROM mygeomtable');
>> curs = fetch(curs);
>> oraIn = curs.Data{1}
oraIn =
oracle.sql.STRUCT@1bd96c8

Does anyone know a way to work *with* this oracle.sql.STRUCT@1bd96c8 object, and send it back to the database?

Ie, something like:
>> curs = exec(conn,'INSERT INTO mygeomtable VALUES (?)', oraIn);

The reason I want to do this, is so that I can upload more complex geometry directly, rather than converting it to a flat SQL string (which has limitations on the size of geometry I can upload).

Please let me know if you have any hints on this.
Thanks,
Sven.

Subject: Database insert java/oracle object directly

From: Ed Yu

Date: 9 Feb, 2010 21:16:04

Message: 2 of 2

Since you are using Oracle GIS extension, you really have to use pure Java to manipulate these Oracle objects. Look at Oracle's documentation on how to insert these Oracle specific (Java) datatype into the database. Good luck!

Ed.

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
database Sven 18 Jan, 2010 15:39:12
java Sven 18 Jan, 2010 15:39:12
oracle Sven 18 Jan, 2010 15:39:12
rssFeed for this Thread

Contact us at files@mathworks.com