From: Vidas Makauskas <v.makauskas@pzu.lt>
To: pgsql-jdbc@postgresql.org
Subject: Re: No Primary Keys (pg7.4.2 on SLES9)
Date: Wed, 5 Apr 2006 08:25:07 +0300
Message-ID: <001401c65871$4d37f760$8400010a@pzu.lt> (raw)
In-Reply-To: <Pine.BSO.4.63.0604041624460.13705@leary2.csoft.net>
Thanks for fast response,
I found one more way:
1. create table WITH OIDS (by default)
st.executeUpdate("CREATE TABLE public.testas
(loid integer, othe integer PRIMARY KEY)");
2. executeQuery("SELECT p.oid, p.* ...
"SELECT p.*" - not suitable, must be "SELECT p.oid, p.*"
Best regards
-----Original Message-----
From: Kris Jurka [mailto:books@ejurka.com]
Sent: Wednesday, April 05, 2006 12:34 AM
To: Vidas Makauskas
Cc: pgsql-jdbc@postgresql.org
Subject: Re: [JDBC] No Primary Keys (pg7.4.2 on SLES9)
On Mon, 3 Apr 2006, Vidas Makauskas wrote:
> I get error NO PRIMARY KEY from prs.moveToInsertRow();
>
> Postgres 7.4.2 on with /usr/share/pgsql/pg73b1jdbc3.jar
>
> Statement st = pg.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,
> ResultSet.CONCUR_UPDATABLE);
> st.executeUpdate("CREATE TABLE public.testas (loid integer PRIMARY KEY)
> WITHOUT OIDS");
> ResultSet prs = st.executeQuery("SELECT p.* FROM public.testas p");
> prs.moveToInsertRow();
Older JDBC drivers do not support schema qualified table names for
updatable result sets. Try a newer version:
http://jdbc.postgresql.org/download.html
Kris Jurka
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: v.makauskas@pzu.lt
Subject: Re: No Primary Keys (pg7.4.2 on SLES9)
In-Reply-To: <001401c65871$4d37f760$8400010a@pzu.lt>
References: <Pine.BSO.4.63.0604041624460.13705@leary2.csoft.net> <001401c65871$4d37f760$8400010a@pzu.lt>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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