From xavier.marquis@cegetel.net Thu Jul 14 10:55:44 2005 X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 18CBB5280C for ; Thu, 14 Jul 2005 07:55:44 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 55191-02 for ; Thu, 14 Jul 2005 10:55:38 +0000 (GMT) Received: from smtp.cegetel.net (mf01.sitadelle.com [212.94.174.68]) by svr1.postgresql.org (Postfix) with ESMTP id 4317C529F3 for ; Thu, 14 Jul 2005 07:55:37 -0300 (ADT) Received: from freeman (unknown [84.5.169.205]) by smtp.cegetel.net (Postfix) with SMTP id B42B7318546 for ; Thu, 14 Jul 2005 12:55:39 +0200 (CEST) Message-ID: <003101c58863$cb9e3490$cda90554@freeman> From: To: Subject: java.sql.SQLException: Cannot instantiate a SerialArray object with null parameters, when using CachedRowSetImpl Date: Thu, 14 Jul 2005 13:04:24 +0200 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_002E_01C58874.8EA180E0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1506 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.575 tagged_above=0 required=5 tests=AWL, DNS_FROM_RFC_ABUSE, FORGED_RCVD_HELO, HTML_50_60, HTML_MESSAGE, NO_REAL_NAME X-Spam-Level: X-Archive-Number: 200507/78 X-Sequence-Number: 13226 This is a multi-part message in MIME format. ------=_NextPart_000_002E_01C58874.8EA180E0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hello, I use PostgreSQL 8.0.3 and following associated drivers :=20 =20 postgresql-8.0-311.jdbc2.jar postgresql-8.0-311.jdbc2ee.jar postgresql-8.0-311.jdbc3.jar =20 I want to use CachedRowSetImpl to populate one row in the following = table : =20 CREATE TABLE "Form2" ( form2member3 int4, form2member5 int8[], ) WITHOUT OIDS; I have inserted a row using pgAdmin into the good table.=20 Now, I simply try to populate the row : public class Main2 { public static void main(String[] args) { try { DriverManager.registerDriver(new org.postgresql.Driver()); String SQLRequest=3D"SELECT form2member3,form2member5::int8[] from = \"Form2\"; CachedRowSet cached_row =3D new CachedRowSetImpl(); cached_row.setUrl("jdbc:postgresql://localhost:5432/myBDD"); cached_row.setUsername("postgres"); cached_row.setPassword("postgres"); =20 cached_row.setCommand(SQLRequest); cached_row.execute(); =20 Object test =3D cached_row.getArray("form2member5"); } catch(Exception e) { e.printStackTrace(); } } } And I receive the following exception : java.sql.SQLException: Cannot instantiate a SerialArray object with null = parameters at javax.sql.rowset.serial.SerialArray.(SerialArray.java:124) at com.sun.rowset.CachedRowSetImpl.populate(CachedRowSetImpl.java:641) at = com.sun.rowset.internal.CachedRowSetReader.readData(CachedRowSetReader.ja= va:170) at com.sun.rowset.CachedRowSetImpl.execute(CachedRowSetImpl.java:736) at com.sun.rowset.CachedRowSetImpl.execute(CachedRowSetImpl.java:1385) at Main2.main(Main2.java:34) Does someone know where I am wrong, and what I must do to make it work ? ------=_NextPart_000_002E_01C58874.8EA180E0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hello,
 
I use PostgreSQL 8.0.3 and following = associated=20 drivers=20 : 
  
postgresql-8.0-311.jdbc2.jar
postgresql-8.0= -311.jdbc2ee.jar
postgresql-8.0-311.jdbc3.jar
 
I=20 want to use CachedRowSetImpl to populate one row in the following table=20 :
 
CREATE TABLE "Form2"
(
    = form2member3=20 int4,
    form2member5 int8[],
)
WITHOUT=20 OIDS;
 
I have inserted a row using = pgAdmin into the=20 good table.
 
Now, I simply try to populate = the row=20 :
 
public class Main2 {
 
 public static void main(String[] = args)=20 {
  try
  {
   DriverManager.= registerDriver(new=20 org.postgresql.Driver());
   String = SQLRequest=3D"SELECT=20 form2member3,form2member5::int8[] from=20 \"Form2\";
   CachedRowSet cached_row =3D new=20 CachedRowSetImpl();
   cached_row.setUrl("jdbc:postgres= ql://localhost:5432/myBDD");
   cached_row.setUsername(= "postgres");
   cached_row.setPassword("postgres");&nbs= p;  
   cached_row.setCommand(SQLRequest);   cached_row.execute();
   
 &= nbsp; Object=20 test =3D=20 cached_row.getArray("form2member5");
  }
  catc= h(Exception=20 e)
  {
   e.printStackTrace();
 &n= bsp;}
 }
}
 
And I receive the following exception=20 :
 
java.sql.SQLException: Cannot = instantiate a=20 SerialArray object with null parameters
at=20 javax.sql.rowset.serial.SerialArray.<init>(SerialArray.java:124)
at=20 com.sun.rowset.CachedRowSetImpl.populate(CachedRowSetImpl.java:641)
at=20 com.sun.rowset.internal.CachedRowSetReader.readData(CachedRowSetReader.ja= va:170)
at=20 com.sun.rowset.CachedRowSetImpl.execute(CachedRowSetImpl.java:736)=
at=20 com.sun.rowset.CachedRowSetImpl.execute(CachedRowSetImpl.java:1385)
at Main2.main(Main2.java:34)
 
Does someone know where I am wrong, and what I must do to make it work ?
 
 
 
------=_NextPart_000_002E_01C58874.8EA180E0-- From a.vokac@sh.cvut.cz Wed Aug 10 09:33:47 2005 X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id A402F52AE9 for ; Wed, 10 Aug 2005 06:33:47 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 67693-09 for ; Wed, 10 Aug 2005 09:33:38 +0000 (GMT) Received: from smtp-out3.iol.cz (smtp-out3.iol.cz [194.228.2.91]) by svr1.postgresql.org (Postfix) with ESMTP id 022F5528EE for ; Wed, 10 Aug 2005 06:33:36 -0300 (ADT) Received: from antivir3.iol.cz (unknown [192.168.30.206]) by smtp-out3.iol.cz (Internet on Line ESMTP server) with ESMTP id 35470318508 for ; Wed, 10 Aug 2005 11:33:39 +0200 (CEST) Received: from localhost (antivir3.iol.cz [127.0.0.1]) by antivir3.iol.cz (Postfix) with ESMTP id 2A7056DC004 for ; Wed, 10 Aug 2005 11:33:39 +0200 (CEST) Received: from smtp-out3.iol.cz (unknown [192.168.30.28]) by antivir3.iol.cz (Postfix) with ESMTP id 137676DC003 for ; Wed, 10 Aug 2005 11:33:39 +0200 (CEST) Received: from [192.168.10.3] (r4ca138.chello.upc.cz [84.42.206.138]) by smtp-out3.iol.cz (Internet on Line ESMTP server) with ESMTP id 9A64E3C002 for ; Wed, 10 Aug 2005 11:33:34 +0200 (CEST) Message-ID: <42F9C9EB.4030508@sh.cvut.cz> Date: Wed, 10 Aug 2005 11:33:31 +0200 From: "a.vokac@sh.cvut.cz" User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.7) Gecko/20050419 X-Accept-Language: cs, en-us, en MIME-Version: 1.0 To: pgsql-jdbc@postgresql.org Subject: Re: java.sql.SQLException: Cannot instantiate a SerialArray object Content-Type: multipart/alternative; boundary="------------090608060601030304020402" X-Virus-Scanned: amavisd-new at iol.cz X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.253 tagged_above=0 required=5 tests=HTML_MESSAGE, HTML_TITLE_EMPTY, UPPERCASE_25_50 X-Spam-Level: X-Archive-Number: 200508/69 X-Sequence-Number: 13638 This is a multi-part message in MIME format. --------------090608060601030304020402 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Probe this: CREATE TABLE "Form2" ( form2member3 int4, form2member5 int8[] _*DEFAULT '{0,0,0}'::int8[]*_, ) WITHOUT OIDS; --------------090608060601030304020402 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit Probe this:

CREATE TABLE "Form2"
(
    form2member3 int4,
    form2member5 int8[] DEFAULT '{0,0,0}'::int8[],
)
WITHOUT OIDS;
--------------090608060601030304020402--