ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From galo <anglorva...@gmail.com>
Subject postgresql: java array -> jdbc array
Date Tue, 21 Aug 2007 14:09:53 GMT
Hi, I'm trying to create a parameter map to insert/update a boolean array
into a table.

This is my statement, and column2 is a boolean[]

<insert id="insertBlah" parameterMap="paramMap">
  INSERT INTO mytable (column1, column2)
  VALUES (#column1#, #column2#)

I've tried  INSERT INTO mytable (column1, column2)  VALUES (#column1#,
with a dummy array as a string, and it works, so I thought I could just pass
a string

<parameterMap id="paramMap" class="java.util.Map">
  <parameter property="column1" javaType=" java.lang.Boolean"  />
  <parameter property="column2" javaType="java.lang.String"  />

I get: ERROR: column "column2" is of type boolean[] but expression is of
type character varying

I've tried an endless list of combinations, passing either Strings, Boolean
arrays, etc. and none work.

I'm trying to write my own Type handler, but i get into a similar problem,
whatever i insert in the setter ibatis complains it's not a boolean[]

How am i supposed to do this? (I can't find any reference to arrays in the


View raw message