Skip site navigation (1) Skip section navigation (2)


From: Dave Cramer <pg(at)fastcrypt(dot)com>
To: vasylenko(at)uksatse(dot)org(dot)ua
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re:
Date: 2007-01-11 12:33:11
Message-ID: (view raw or whole thread)
Lists: pgsql-jdbc
On 11-Jan-07, at 1:42 AM, vasylenko(at)uksatse(dot)org(dot)ua wrote:

> Dave and Andre, thank for your responses!
> The JDBC driver needs the Primary Key in Select query to identify  
> the row.
> I was mistaken thinking of  doing without it,
> ResultSet makes updates in Row  executing the
> java.sql.Connection.prepareStatement("UPDATE holidays SET  "g_name"  
> = ?
> WHERE "id" = ?")
> and  executeUpdate()
> when user makes call ResultSet.updateRow() and "id" - the Primary  
> Key in
> database's table.  It's logicaly for me now....
> The same is going on whe users call ResultSet.insertRow().
> The only question presents, why the JDBCDriver developers want to find
> PrimaryKey or oid field inside method "moveToInsertRow()"?
> I think it mustn't be JDBCDriver problem.
> It is the Postrgre server trouble or developers who use JDBCDriver.
Can you explain this more, or send a small test case. There should be  
no reason to get a primary key simply to move to insert row.
We do need the primary key in the dataset, but other than that we  
shouldn't fail on move to insert row ?

> I'm going to do in way Andre has recommended and use id field in  
> query as Dave has advised.
> Thank!
> ---------------------------(end of  
> broadcast)---------------------------
> TIP 1: if posting/reading through Usenet, please send an appropriate
>        subscribe-nomail command to majordomo(at)postgresql(dot)org so that  
> your
>        message can get through to the mailing list cleanly

In response to

  • Re: at 2007-01-11 06:42:39 from vasylenko

pgsql-jdbc by date

Next:From: James NeffDate: 2007-01-11 14:28:08
Subject: connection pooling for postgres
Previous:From: Deval kulshresthaDate: 2007-01-11 11:56:49
Subject: Test db connection to 'jdbc:postgresql://grid-master:5432/arco' ... Failed (1)

Privacy Policy | About PostgreSQL
Copyright © 1996-2015 The PostgreSQL Global Development Group