Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 5687EB5DBD6 for ; Tue, 19 Jul 2011 10:54:44 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 14415-01 for ; Tue, 19 Jul 2011 13:54:38 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pv0-f174.google.com (mail-pv0-f174.google.com [74.125.83.174]) by mail.postgresql.org (Postfix) with ESMTP id 985B5B5DBC8 for ; Tue, 19 Jul 2011 10:54:37 -0300 (ADT) Received: by pvg12 with SMTP id 12so3877543pvg.19 for ; Tue, 19 Jul 2011 06:54:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject :content-type; bh=jqcgA8YTIxvUTygS4g6BpvtpfnTPBGlZxH1FOrbchbk=; b=fNolKo7IE3JX1ys9BnHEdNPN0YcURJ8vFQ27Eqj2L9kfa48xJYORfRZzEDm1mAQZSm GXP+4emEgyqbNGZ9p8C3UtiQQmaXkYdCXNzGhIY+IbFDsFfSRgxLaZNICCslOO+dT3NP DYOluikcOQ+0dMw5ZlabSmPhTB2kg2jC1ZzXA= Received: by 10.142.128.12 with SMTP id a12mr3651440wfd.328.1311083676251; Tue, 19 Jul 2011 06:54:36 -0700 (PDT) Received: from [192.168.1.27] (p2018-ipbf4702marunouchi.tokyo.ocn.ne.jp [118.6.181.18]) by mx.google.com with ESMTPS id j7sm4192745wfd.16.2011.07.19.06.54.33 (version=SSLv3 cipher=OTHER); Tue, 19 Jul 2011 06:54:35 -0700 (PDT) Message-ID: <4E243B06.4080000@gmail.com> Date: Mon, 18 Jul 2011 22:54:14 +0900 From: Dang Minh Huong User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:5.0) Gecko/20110624 Thunderbird/5.0 MIME-Version: 1.0 To: pgsql-jdbc@postgresql.org Subject: newbie question how to use java.sql.array Content-Type: multipart/alternative; boundary="------------080705010500060207080800" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.448 tagged_above=-10 required=5 tests=BAYES_00=-1.9, DATE_IN_PAST_24_48=1.34, FREEMAIL_ENVFROM_END_DIGIT=0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, T_TO_NO_BRKTS_FREEMAIL=0.01 X-Spam-Level: X-Archive-Number: 201107/28 X-Sequence-Number: 22032 This is a multi-part message in MIME format. --------------080705010500060207080800 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hi every body, I'm so sorry if this contents was posted in this mailing list. I have to implement java.sql.array to my project now, but now it has suspending by following problem, any body who have experience in using java.sql.array please help me. many thanks for any information. I found in JDBC documents http://jdbc.postgresql.org/development/privateapi/org/postgresql/jdbc4/Jdbc4Array.html#free%28%29 that, using free() method to free an java.sql.array interface, and trying to implement to my project. ||But i could not. In postgresql jdbc does java.sql.array object needs a free() method call to release the resoures that it hold? I've found in org.postgresql.jdbc4Array.free() that, public void free() Throws SQLException { throw Driver.notImplemeted(getClass(),"free()"); } so, when i tried to call it from java.sql.array object, it is returned by the following error. /org.postgresql.util.PSQLException/: Method org.postgresql.jdbc4.Jdbc4Array.free() is not yet implemented at org.postgresql.Dirver.notImplemented(Driver.java:753) at org.postgresql.jdbc4.Jdbc4Array.free(Jdbc4Array.java:46) at array.main(array.java:32) I wonder if need a call free() method when the object has used, why the return off free() method is a throw. And the following is my simple program ... public static void main(String[] args) throws SQLException { String url = "jdbc:postgresql://postgresqlsv01:5555/postgres"; Properties props = new Properties(); props.setProperty("user","test"); props.setProperty("password","test"); Connection con = DriverManager.getConnection(url,props); PreparedStatement pst = con.prepareStatement("insert into test values (?);"); Integer[] data = {1,2,3,4,5,6,7}; java.sql.Array a = con.createArrayOf("integer",data); try{ pst.setArray(1,a); pst.executeUpdate(); pst.close(); }catch(Exception e){ }finally { try{ a.free(); } }catch(Exception ex){ e.printStackTrace(); } } Best regards, Dang Minh Huong --------------080705010500060207080800 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hi every body,

I'm so sorry if this contents was posted in this mailing list.
I have to implement java.sql.array to my project now, but now it has suspending by
following problem, any body who have experience in using java.sql.array please help me.
many thanks for any information.

I found in JDBC documents http://jdbc.postgresql.org/development/privateapi/org/postgresql/jdbc4/Jdbc4Array.html#free%28%29 that,
using free() method to free an java.sql.array interface, and trying to implement to my project.
But i could not. In postgresql jdbc does java.sql.array object needs a
free() method call to release the resoures that it hold?

I've found in org.postgresql.jdbc4Array.free() that,

    public void free()
        Throws SQLException
    {
        throw Driver.notImplemeted(getClass(),"free()");
    }

so, when i tried to call it from java.sql.array object, it is returned by the following error.

org.postgresql.util.PSQLException: Method org.postgresql.jdbc4.Jdbc4Array.free() is not yet  implemented
    at org.postgresql.Dirver.notImplemented(Driver.java:753)
    at org.postgresql.jdbc4.Jdbc4Array.free(Jdbc4Array.java:46)
    at array.main(array.java:32)

I wonder if need a call free() method when the object has used, why the return off free() method is a throw.
And the following is my simple program

...
    public static void main(String[] args) throws SQLException {
        String url = "jdbc:postgresql://postgresqlsv01:5555/postgres";
        Properties props = new Properties();
        props.setProperty("user","test");
        props.setProperty("password","test");
        Connection con = DriverManager.getConnection(url,props);
        PreparedStatement pst = con.prepareStatement("insert into test values (?);");
        Integer[] data = {1,2,3,4,5,6,7};
        java.sql.Array a = con.createArrayOf("integer",data);
        try{
            pst.setArray(1,a);
            pst.executeUpdate();
            pst.close();
        }catch(Exception e){
        }finally {
           try{
                a.free();
            }
        }catch(Exception ex){
            e.printStackTrace();
        }
    }

Best regards,
Dang Minh Huong --------------080705010500060207080800--