Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 176C563273A for ; Wed, 16 Dec 2009 05:47:27 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 69998-02 for ; Wed, 16 Dec 2009 09:47:19 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by mail.postgresql.org (Postfix) with ESMTP id 16C49632641 for ; Wed, 16 Dec 2009 05:47:18 -0400 (AST) Received: by ewy26 with SMTP id 26so835884ewy.3 for ; Wed, 16 Dec 2009 01:47:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=aU4q/MPWSPKRBQ37xDbKVF4xiEMn6b9eipoz2SqOGbc=; b=luRF0GH+IYVRvy775qsslUf4KF6q1x2VWqQMlE5Yif/9UcjDM1iYqZiZBqA+xqpMPa MwX2dZHEIaw61SET42IIU7hu9eZBnYY3XrinJHBGCWrdKESOxnihaCexIpT457UuwsfR q/i58tcE4bklVRDIfV77apTaCHZETN3sOoAV4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=gIp65NePKXeTrosJm6QaGnEhOtY9cJc3I6qzVSjFNzZ55AiI/AGrl7G1K1dizITMIE zLIExokbfQ1nZAqc2Qrlxuvv2+WXtdNY8DLhOGc5UwaKrswH/leWwy8StmPej6anibSt dBK9HkWk2TTOQFg+Uyo6D6xjPXqVAUMig7el0= MIME-Version: 1.0 Received: by 10.213.37.137 with SMTP id x9mr6318722ebd.78.1260956835210; Wed, 16 Dec 2009 01:47:15 -0800 (PST) Date: Wed, 16 Dec 2009 12:47:15 +0300 Message-ID: Subject: Error when attempting to call Connection.createArrayOf() method From: Allan Kamau To: pgsql-jdbc@postgresql.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.11 tagged_above=-10 required=5 tests=BAYES_05=-1.11 X-Spam-Level: X-Archive-Number: 200912/46 X-Sequence-Number: 20127 I am trying create an array of text to pass to a postgreSQL function and I am getting the following error "java.lang.AbstractMethodError: org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.createArrayOf(Ljava/lang/String;[Ljava/lang/Object;)Ljava/sql/Array;" I have tried googling for a possible solution without much success the closed I got was the discussion in this thread "http://archives.postgresql.org/pgsql-jdbc/2009-04/msg00013.php" but I am unable to find the successful conclusion/solution for this error. I am using JDBC driver (postgresql-8.4-701.jdbc4.jar) for postgreSQL and commons-dbcp-1.2.2.jar for connection pooling. My code like like this. public static int persistUserInput( Connection conn,String _user_input_id,Map> userInputMap )throws SQLException { int _rows_affected=-1; String _input_name=null; String _input_values[]=new String[0]; PreparedStatement ps=null;ResultSet rs=null; for (Map.Entry> y : userInputMap.entrySet()) { _input_name=y.getKey(); Vector v=y.getValue(); _input_values=v.toArray(_input_values); try { String _sql_query="" +" SELECT persist_user_input(?,?,?);" ; ps=conn.prepareStatement(_sql_query); ps.setString(1,_user_input_id); ps.setString(2,_input_name); ps.setArray(3,conn.createArrayOf("text",_input_values)); rs=ps.executeQuery(); if(rs.next()) { _rows_affected=rs.getInt(1); } rs.close(); ps.close(); } catch(SQLException e) { throw e; } finally { /* rs.close(); ps.close(); if(rs!=null&&!rs.isClosed()) { rs.close(); } rs=null; if(ps!=null&&!ps.isClosed()) { ps.close(); } ps=null; */ } } return _rows_affected; }