From: | "David Hooker" <dhooker(at)bTrade(dot)com> |
---|---|
To: | <pgsql-jdbc(at)postgresql(dot)org> |
Subject: | Problem with updateRow() |
Date: | 2003-03-20 00:54:50 |
Message-ID: | DD840B0E9362D411978200508BD898E0017C81EF@btcorp2.corp.btrade.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-jdbc |
I'm using PostgreSQL 7.3.1 server, and the pg73jdbc2.jar file from the
website (file dated 2/13/2003 on my machine).
I have in my code a select statement like this:
String sql = "SELECT FILENAME, BOUNDARY FROM " + tableName + "
WHERE NAME = '" + name + "' AND CONTEXT = '" + context + "'";
logger.finest("SQL: " + sql);
ResultSet result = stmt.executeQuery(sql);
Later in my code I have this:
while (result.next())
{
// ...
result.updateString("BOUNDARY", event.getBoundary());
result.updateRow();
updated = true;
}
Here's the error I get:
java.sql.SQLException: No Primary Keys
Here's what the tables look like in psql:
simpletest=# \d lfs_mappings_559
Table "lfs_mappings_559"
Attribute | Type | Modifier
----------------+------------------------+----------
name | character varying(40) | not null
context | character varying(80) | not null
filename | character varying(300) | not null
boundary | character varying(50) |
insertion_time | real | not null
can_purge | character varying(8) |
Index: lfs_mappings_559_pkey
simpletest=# \d lfs_mappings_559_pkey
Index "lfs_mappings_559_pkey"
Attribute | Type
-----------+-----------------------
name | character varying(40)
context | character varying(80)
unique btree (primary key)
simpletest=#
Why is this happening? Are updateable resultSets not supported?
From | Date | Subject | |
---|---|---|---|
Next Message | David Hooker | 2003-03-20 00:58:43 | Re: Problem with updateRow() |
Previous Message | Daniel Bruce Lynes | 2003-03-19 23:11:03 | Re: JDBC driver, PGSQL 7.3.2 and accents characters |