Re: Insert Row to ResultSet problem....java.sql.SQLException:

From: Kris Jurka <books(at)ejurka(dot)com>
To: "Jason L(dot) van Brackel" <jasonvanbrackel(at)speakeasy(dot)net>
Cc: <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Insert Row to ResultSet problem....java.sql.SQLException:
Date: 2003-12-16 19:20:17
Message-ID: Pine.LNX.4.33.0312161408160.25487-100000@leary.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On Tue, 16 Dec 2003, Jason L. van Brackel wrote:

> ResultSet addressInfo = null; // ResultSet for Address Info
> sql = "SELECT * FROM address;";
> addressInfo = migr.queryStatement(migr.postgreSQLConnection, sql);
> addressInfo.moveToInsertRow();
> ..... this is where I get this exception
> java.sql.SQLException: No Primary Keys
> at org.postgresql.jdbc2.AbstractJdbc2ResultSet.isUpdateable(AbstractJdbc2ResultSet.java:1363)
> at org.postgresql.jdbc2.AbstractJdbc2ResultSet.moveToInsertRow(AbstractJdbc2ResultSet.java:697)
> at com.cimconsultants.EFRMigration.MigrationUtil.main(MigrationUtil.java:62)

I think the problem is the semicolon after address. It is confusing
the driver into trying to update a table named "address;". Either
remove the semicolon or put a space between it and the table name.

Kris Jurka

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Jason L. van Brackel 2003-12-16 19:30:29 Re: Insert Row to ResultSet problem....java.sql.SQLException:
Previous Message Jason L. van Brackel 2003-12-16 18:12:23 Insert Row to ResultSet problem....java.sql.SQLException: No Primary Keys