X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id D1A779DC804 for ; Tue, 14 Feb 2006 06:11:41 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 74634-04 for ; Tue, 14 Feb 2006 06:11:39 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from floppy.pyrenet.fr (news.pyrenet.fr [194.116.145.2]) by postgresql.org (Postfix) with ESMTP id EE94D9DC803 for ; Tue, 14 Feb 2006 06:11:25 -0400 (AST) Received: by floppy.pyrenet.fr (Postfix, from userid 106) id BE2BC3093D; Tue, 14 Feb 2006 11:11:26 +0100 (MET) From: "bond" X-Newsgroups: pgsql.sql Subject: passing array(java) to postgre sql function Date: 14 Feb 2006 02:11:20 -0800 Organization: http://groups.google.com Lines: 43 Message-ID: <1139911880.531826.81080@f14g2000cwb.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Complaints-To: groups-abuse@google.com User-Agent: G2/0.2 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322),gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: f14g2000cwb.googlegroups.com; posting-host=220.227.202.145; posting-account=F5paPw0AAAAlKx7vcIynoQhETAucmJ0W To: pgsql-sql@postgresql.org X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0 required=5 tests=[none] X-Spam-Score: 0 X-Spam-Level: X-Archive-Number: 200602/227 X-Sequence-Number: 24237 Hi All, in postgreSql, i have written a function which accepts a String array and inserts the contents to DB. when i tested that function by passing the values like: SELECT TEST_ARRAY('{xxx,yyyy,pppp,wwwwww}'); where TEST_ARRAY is my function name. the records get inserted correctly. But now the problem is how to pass the values from java to this function? I have implemented the java.sql.Array interface, and given the actual implementation to getArray() method, like this: public Object getArray(){ ArrayList temp = new ArrayList(); temp.add("MMMM"); temp.add("NNNN"); temp.add("TTTTT"); temp.add("QQQQQ"); return temp.toArray(); } After this i am passing this.getArray() values to database. but at this point of time i get the following Exception: org.postgresql.util.PSQLException: Unsupported Types value: 2,003 at org.postgresql.jdbc2.AbstractJdbc2Statement.setObject(AbstractJdbc2Statement.java:1630) at org.postgresql.jdbc3.AbstractJdbc3Statement.setObject(AbstractJdbc3Statement.java:1436) at org.postgresql.jdbc2.AbstractJdbc2Statement.setObject(AbstractJdbc2Statement.java:1636) Is this the problem with the driver wht i am usng? Can anyonme please help me to overcome this?? Waiting for your response,