pg.ddx.io pgsql-jdbc@postgresql.org mailing list archive
help / color / mirror / Atom feedjava.sql.SQLException: Cannot instantiate a SerialArray object with null parameters, when using CachedRowSetImpl
2+ messages / 2 participants
[nested] [flat]
* java.sql.SQLException: Cannot instantiate a SerialArray object with null parameters, when using CachedRowSetImpl
@ 2005-07-14 11:04 xavier.marquis@cegetel.net
0 siblings, 0 replies; 2+ messages in thread
From: xavier.marquis@cegetel.net @ 2005-07-14 11:04 UTC (permalink / raw)
To: pgsql-jdbc
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,form2member5::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(SQLRequest);
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(CachedRowSetImpl.java:641)
at com.sun.rowset.internal.CachedRowSetReader.readData(CachedRowSetReader.java: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 ?
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: java.sql.SQLException: Cannot instantiate a SerialArray object
@ 2005-08-10 09:33 a.vokac@sh.cvut.cz <a.vokac@sh.cvut.cz>
0 siblings, 0 replies; 2+ messages in thread
From: a.vokac@sh.cvut.cz @ 2005-08-10 09:33 UTC (permalink / raw)
To: pgsql-jdbc
Probe this:
CREATE TABLE "Form2"
(
form2member3 int4,
form2member5 int8[] _*DEFAULT '{0,0,0}'::int8[]*_,
)
WITHOUT OIDS;
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2005-08-10 09:33 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-07-14 11:04 java.sql.SQLException: Cannot instantiate a SerialArray object with null parameters, when using CachedRowSetImpl xavier.marquis@cegetel.net
2005-08-10 09:33 Re: java.sql.SQLException: Cannot instantiate a SerialArray object a.vokac@sh.cvut.cz <a.vokac@sh.cvut.cz>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox