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?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…