pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: rcolmegna@tiscali.it <rcolmegna@tiscali.it>
To: pgsql-jdbc@postgresql.org
Subject: CachedRowSet insertion problem with serial PK
Date: Fri, 2 Jun 2006 16:48:58 +0200 (CEST)
Message-ID: <24609936.1149259738344.JavaMail.root@ps21> (raw)

hi,

I'm tring postgresql-8.1-407.jdbc3.jar (with PG 7.4.3 srv) and 
CachedRowSet (Sun implementation).

I have a small test table: it has two fields: 
1) id  SERIAL NOT NULL PRIMARY KEY
2) info VARCHAR(100)


I try this java code:

    CachedRowSet rs;
    ...
    rs.setCommand("select id,info from a WHERE id<?");
    rs.setInt(1, 10);
    ...
    rs.moveToInsertRow();
    rs.setString(2, "zzzz2");
    rs.insertRow();

but I obtain this error:
"SQLException: Failed on insert row" (generated from the insertRow() 
line).

I sniffed the network-connection betweend DB-srv and JDBC-client, and 
I noted that
the INSERT instruction isn't fired against the DB.  If I ask if 
"isAutoIncrement(<id_idx>)"
I obtain a true reply.

Any idea?

TIA
Roberto Colmegna





		
La gara più entusiasmante dell'anno! 

Gioca e corri alla velocità della luce sui 18 circuiti di Intel Speed Contest 2006!

I più bravi vincono Notebook Sony VAIO, iPod da 60 GB e altro ancora... 

Sfida gli amici!

http://intelspeedcontest2006.tiscali.it/ 
	



view thread (2+ messages)  latest in thread

Message-ID: <24609936.1149259738344.JavaMail.root@ps21>
Permalink:  ../24609936.1149259738344.JavaMail.root@ps21/
Also on:    postgresql.org/message-id/24609936.1149259738344.JavaMail.root@ps21

 · 

reply

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: rcolmegna@tiscali.it
  Subject: Re: CachedRowSet insertion problem with serial PK
  In-Reply-To: <24609936.1149259738344.JavaMail.root@ps21>
  References: <24609936.1149259738344.JavaMail.root@ps21>

* 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