agora inbox for pljava-dev@postgresql.org  
help / color / mirror / Atom feed
[Pljava-dev] Updating an array
4+ messages / 0 participants
[nested] [flat]

* [Pljava-dev] Updating an array
@ 2006-09-13 10:46  
  0 siblings, 1 reply; 4+ messages in thread

From:  @ 2006-09-13 10:46 UTC (permalink / raw)

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!





^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* [Pljava-dev] Updating an array
@ 2006-09-13 12:12  
  parent: 
  0 siblings, 1 reply; 4+ messages in thread

From:  @ 2006-09-13 12:12 UTC (permalink / raw)

Hi Bendik,
This looks like a deficiency in the PL/Java JDBC driver. Could you 
please enter it as a bug?

Thanks,
Thomas Hallgren


Bendik Rognlien Johansen wrote:
> 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!
>
> _______________________________________________
> Pljava-dev mailing list
> Pljava-dev at gborg.postgresql.org
> http://gborg.postgresql.org/mailman/listinfo/pljava-dev
>   





^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* [Pljava-dev] Updating an array
@ 2006-09-13 12:58  
  parent: 
  0 siblings, 1 reply; 4+ messages in thread

From:  @ 2006-09-13 12:58 UTC (permalink / raw)

Ok, thanks. I added it as a bug.
Any way of getting around this until the bug is fixed?


On Sep 13, 2006, at 2:12 PM, Thomas Hallgren wrote:

> Hi Bendik,
> This looks like a deficiency in the PL/Java JDBC driver. Could you  
> please enter it as a bug?
>
> Thanks,
> Thomas Hallgren
>
>
> Bendik Rognlien Johansen wrote:
>> 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!
>>
>> _______________________________________________
>> Pljava-dev mailing list
>> Pljava-dev at gborg.postgresql.org
>> http://gborg.postgresql.org/mailman/listinfo/pljava-dev
>>
>





^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* [Pljava-dev] Updating an array
@ 2006-09-14 01:06  
  parent: 
  0 siblings, 0 replies; 4+ messages in thread

From:  @ 2006-09-14 01:06 UTC (permalink / raw)

I guess you could pass a String parameter using the PostgreSQL string 
format for integer arrays.

Regards,
Thomas Hallgren

Bendik Rognlien Johansen wrote:
> Ok, thanks. I added it as a bug.
> Any way of getting around this until the bug is fixed?
> 
> 
> On Sep 13, 2006, at 2:12 PM, Thomas Hallgren wrote:
> 
>> Hi Bendik,
>> This looks like a deficiency in the PL/Java JDBC driver. Could you  
>> please enter it as a bug?
>>
>> Thanks,
>> Thomas Hallgren
>>
>>
>> Bendik Rognlien Johansen wrote:
>>> 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!
>>>
>>> _______________________________________________
>>> Pljava-dev mailing list
>>> Pljava-dev at gborg.postgresql.org
>>> http://gborg.postgresql.org/mailman/listinfo/pljava-dev
>>>





^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2006-09-14 01:06 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-09-13 10:46 [Pljava-dev] Updating an array 
2006-09-13 12:12 ` 
2006-09-13 12:58   ` 
2006-09-14 01:06     ` 

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox