Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 341089FA50F for ; Tue, 10 Oct 2006 10:15:33 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 96573-08 for ; Tue, 10 Oct 2006 10:15:31 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.173]) by postgresql.org (Postfix) with ESMTP id 2C3059FA4F0 for ; Tue, 10 Oct 2006 10:15:28 -0300 (ADT) Received: by ug-out-1314.google.com with SMTP id 30so720143ugc for ; Tue, 10 Oct 2006 06:15:28 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:mime-version:content-transfer-encoding:message-id:content-type:to:from:subject:date:x-mailer; b=KXLVsyD5Nuz2dPuL2z8sV37Hg8DzNBN4A01joMwH/fEBz4+Lq1cev0hYOm5FBQ5+i5sr3B+hUrkSxa3bx7+l24Fr8nVEgGVlG0O3QiRFs0e/bYHNUPGIsZx+3jpbLZ4YY5CaK5dGbjSmkv/7CepAnvH7SSutKeSyKblDzggyUqQ= Received: by 10.67.24.13 with SMTP id b13mr8228078ugj; Tue, 10 Oct 2006 06:15:27 -0700 (PDT) Received: from ?10.80.1.43? ( [85.221.54.254]) by mx.google.com with ESMTP id o30sm2694024ugd.2006.10.10.06.15.27; Tue, 10 Oct 2006 06:15:27 -0700 (PDT) Mime-Version: 1.0 (Apple Message framework v752.2) Content-Transfer-Encoding: 7bit Message-Id: <533747B3-BC3C-4D07-A2B8-A3C86B85C718@gmail.com> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed To: pgsql-jdbc@postgresql.org From: Bendik Rognlien Johansen Subject: Retrieving arrays Date: Tue, 10 Oct 2006 15:15:23 +0200 X-Mailer: Apple Mail (2.752.2) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.189 tagged_above=0 required=5 tests=AWL, DNS_FROM_RFC_ABUSE, SPF_PASS X-Spam-Level: X-Archive-Number: 200610/59 X-Sequence-Number: 15942 Hello, I wrote this method to read arrays from my result set. public class MyClass { public T[] getArray(ResultSet rs, String column) throws Exception { if(rs.getArray(column) != null) { return (T[]) rs.getArray(column).getArray(); } return null; } } I call i like this: String[] values = MyClass.getArray(rs, "myStringArrayColumn")); This works fine. ( "myStringArrayColumn" is of type character varying(64)[]) But, when I call: Integer[] values = MyClass.getArray(rs, "myIntegerArrayColumn")); ( "myIntegerArrayColumn" is of type integer[]) I get a: java.lang.ClassCastException: [I Any ideas? Thanks