[Pljava-dev] Updating an array

From: bensmailinglists at gmail(dot)com (Bendik Rognlien Johansen)
To:
Subject: [Pljava-dev] Updating an array
Date: 2006-09-13 10:46:21
Message-ID: 6EEAC261-29D8-4C92-852E-3B03A513352F@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pljava-dev

Hello, I am trying to update an array of integers using a prepared
statement.

Column "categories" in the table "records" is of type integer[]

String updateSQL = "UPDATE records SET categories = ? WHERE id = ?;";
PreparedStatement updateStatement = getConnection().prepareStatement
(updateSQL);

int[] test = {11,22,33};

updateStatement.setObject(1, test);
updateStatement.setInt(2, 123);
updateStatement.execute();

I get the following error:
ERROR: java.sql.SQLException: No such SQL type: 2003

I also tried Integer[]. Same problem.

Is there any way to make this work?

Thanks!

Responses

Browse pljava-dev by date

  From Date Subject
Next Message Bendik Rognlien Johansen 2006-09-13 11:09:14 [Pljava-dev] Function returning array of rows
Previous Message Guy Rouillier 2006-09-12 20:40:46 [Pljava-dev] Hello World example failure