post an array using a bind variable
19876Oct 2 2003 — edited Jun 5 2007I have collected an array of oracle.jbo.domain.Number [] that represent coordinates for a geometry. I now want to insert this into the database using a Statement, e.g.
"INSERT INTO GEOM_TABLE (ID, GEOMETRY)
VALUES
(1,
MDSYS.SDO_GEOMETRY(
2003
, NULL
, NULL
, MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,1)
, MDSYS.SDO_ORDINATE_ARRAY(:1)))"
and then bind :1 to an ARRAY object. How can I do this?
I found some example code:
ArrayDescriptor desc = ArrayDescriptor.createDescriptor("MDSYS.SDO_ORDINATE_ARRAY",conn);
ARRAY newArray = new ARRAY(desc, conn, elements);
but I do not know how to get a connection because I want it to use the transaction already used by the AM.