Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I am trying to pass an array of geometry to a postgis function using JDBC with JAVA:

            CallableStatement proc = conn.prepareCall("{ ? = call somefunc(?) }");
            proc.registerOutParameter(1, 7);
            PGgeometry[] arr = new PGgeometry[2];
            arr[0] = a;
            arr[1] = b;
            proc.setArray(2, conn.createArrayOf("geometry", arr));
            proc.execute();

a,b are valid PGgeometry types. I am getting this exception:

Exception in thread "main" java.lang.AbstractMethodError: org.postgresql.jdbc3g.Jdbc3gConnection.createArrayOf(Ljava/lang/String;[Ljava/lang/Object;)Ljava/sql/Array;

Is this even possible to do? I found no good answer for that.

Thanks!

share|improve this question

1 Answer 1

Found the issue, not related to geometry type. I was JDBC3 driver, replacing it to JDBC4 driver solved it!

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.