setArray

Поиск
Список
Период
Сортировка
От Alex Stienstra
Тема setArray
Дата
Msg-id 20070216115103.8tagbdi2edy8g8kk@webmail.versatel.nl
обсуждение исходный текст
Ответы Re: setArray  (Miroslav Šulc <miroslav.sulc@startnet.cz>)
Список pgsql-jdbc
Hi,

Iam trying to set an array in a prepared statement like this:

PreparedStatement stmnt = ds.prepareStatement(
  "INSERT INTO trainingen (\"Atleet\", \"Datum\", \"Tijdstip\",
\"Afstand\", \"Tijd (Zone)\") VALUES (?,?,?,?,?)"
);
    stmnt.setString(5, "{1,2,3,4,5,6}");

Assuming that the 5th parameter is an array of integer i get the follow
error message:

ERROR: column "Tijd (Zone)" is of type integer[] but expression is of
type character varying

I understood from previous discussions that the driver underwater will
convert the parameter of setArray
into a string representation like i do in the example above. I there
any other way of setting an array
field in a prepared statement?

Alex.



В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Ken Johanson
Дата:
Сообщение: Re: Synthesize support for Statement.getGeneratedKeys()?
Следующее
От: "j.random.programmer"
Дата:
Сообщение: Bug in metadata.getColumns()/ORDINAL_POSITION