Re: [INTERFACES] Postgresql and JDBC - Mailing list pgsql-jdbc

From Peter T Mount
Subject Re: [INTERFACES] Postgresql and JDBC
Date
Msg-id 980845899.3a76854b0de35@webmail.retep.org.uk
Whole thread Raw
Responses Re: Re: [INTERFACES] Postgresql and JDBC
List pgsql-jdbc
Quoting Wayne Johnson <wdtj@yahoo.com>:

> I've got some questions on using POSTGRESQL with JDBC.  Some folks on
> the
> Novice mailing list suggested I use the interfaces mailing list, but
> the
> web site suggests that I should use another.  Which mailing list is
> appropriate.

pgsql-jdbc@postgresql.org - its a new list created due to the ammount of
traffic.

I've got to update the jdbc pages this week.

> I would like to do a read & update of a single record.  I've seen
> several
> examples of using JDBC to update an entire table, but I'm only looking
> to
> modify a single record.

Standard SQL, ie UPDATE table SET col=value WHERE keycol=keyvalue;

Then use executeUpdate() from within Statement.

The basic example in the source included this.

>
> Is this a case where I should use getCursorName?  How do I then do an
> UPDATE to only modify that single record?  Is this multi user safe?

No, cursors are mainly used to manage large result sets.

> I've
> tried the JDBC 2.0 updateXXX functions, but they are apparently not
> implemented for Postgresql yet.

No. UpdateableResultSet is not yet available (partly done), and you can't
guarantee it working on all ResultSet's anyhow (see the JDBC2.0 specs).

>
> Are there any good (in depth) examples of JDBC out there?  The only
> ones
> I've seen are limited to a simple SELECT or UPDATE.

The source has some (src/interfaces/jdbc/example)

Peter

--
Peter Mount peter@retep.org.uk
PostgreSQL JDBC Driver: http://www.retep.org.uk/postgres/
RetepPDF PDF library for Java: http://www.retep.org.uk/pdf/

pgsql-jdbc by date:

Previous
From: Peter T Mount
Date:
Subject: Re: [INTERFACES] jdbc: v7.1 bug (letter accent)
Next
From: Peter T Mount
Date:
Subject: Re: Re: Patch for jdbc Makefile