Home > Archive > PostgreSQL JDBC > July 2005 > java.sql.SQLException: Cannot instantiate a SerialArray object with null parameters, when using Cac









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author java.sql.SQLException: Cannot instantiate a SerialArray object with null parameters, when using Cac
xavier.marquis@cegetel.net

2005-07-14, 7:23 am

Hello,

I use PostgreSQL 8.0.3 and following associated drivers :

postgresql-8.0-311.jdbc2.jar
postgresql-8.0-311.jdbc2ee.jar
postgresql-8.0-311.jdbc3.jar

I want to use CachedRowSetImpl to populate one row in the following table :

CREATE TABLE "Form2"
(
form2member3 int4,
form2member5 int8[],
)
WITHOUT OIDS;

I have inserted a row using pgAdmin into the good table.

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="SELECT form2member3,form2me
mber5::int8[] from \"Form2\";
CachedRowSet cached_row = new CachedRowSetImpl();
cached_row.setUrl("jdbc:postgresql://localhost:5432/myBDD");
cached_row.setUsername("postgres");
cached_row.setPassword("postgres");
cached_row. setCommand(SQLReques
t);
cached_row.execute();

Object test = 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.<init>(SerialArray.java:124)
at com.sun.rowset.CachedRowSetImpl. populate(CachedRowSe
tImpl.java:641)
at com.sun.rowset.internal.CachedRowSetReader. readData(CachedRowSe
tReader.java:170)
at com.sun.rowset.CachedRowSetImpl. execute(CachedRowSet
Impl.java:736)
at com.sun.rowset.CachedRowSetImpl. execute(CachedRowSet
Impl.java:1385)
at Main2.main(Main2.java:34)

Does someone know where I am wrong, and what I must do to make it work ?



Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com