I'm trying to bind a prepared statement parameter which is a "multidimensional" PostgreSQL array. Here's an array example (column type is numeric[]
):
{{1,10},{2,20}}
How do I bind a value like that using a prepared statement? I tried:
stmt.setObject(1, "{{1,10},{2,20}}", Types.ARRAY);
It didn't work:
Cannot cast an instance of java.lang.String to type Types.ARRAY
Any ideas?