A google resulted in this link: oracle - jgeometry cannot be resolved to a type - Stack Overflow
You can fashion simple SQL in the form:
INSERT INTO foo(geometry) VALUES(
MDSYS.SDO_GEOMETRY(!gtype!,!srid!,NULL,
MDSYS.SDO_ELEM_INFO_ARRAY(
!int_eleminfo_array_members!),
MDSYS.SDO_ORDINATE_ARRAY(
!double_ordinate_array_members!)
) );
but you quickly run out of the maximum number of comma-delimited terms. Which is where the JGeometry object comes in. You can plug the gtype, srid, eleminfo array, and ordinate array into the JGeometry constructor, then pass the STRUCT into JDBC.
The code is simple enough, but be sure to validate multi-ring shapes (simple polygon with one exterior ring, polygon with one exterior ring and one interior ring, polygon with one exterior and two interior rings, polygon with two exterior rings, polygon with one interior ring in one of three exterior rings, polygon with multiple interior rings in multiple exterior rings,...). They're all formatted the same in JSON (array of array of x,y pairs), but manifest differently in the resulting geometry (einfo codes). If ArcGIS generated the JSON in the first place, the ring orientation should be reliable (first is exterior, interior rings are in reverse order [area calculation by trapezoid rule returns opposite sign]). It's a bit tedious but not difficult. You may need to reverse the part arrays if Oracle is expecting a different order (left hand rule vs right hand rule; I don't think JSON cares, so long as it's consistent).
I used graph paper to assemble a bunch of boxes and triangles with labels like p1x, p1y, p2x,.... and encoded the JSON from the labels with search/replace. Assembling a test harness was probably harder than the code (especially because I hosed one of the test cases).
- V