From: | Kaarle Kaila <kaarle(dot)kaila(at)iki(dot)fi> |
---|---|
To: | pgsql-jdbc(at)postgresql(dot)org |
Subject: | Updateable ResultSet |
Date: | 2002-08-17 17:07:48 |
Message-ID: | 200208172007.48333.kaarle.kaila@iki.fi |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-jdbc |
hi,
I have a Java application that inserts data (using jdbc) in the database with
methods similar to the ones below.
These methods function in MS Access 2000 and MySQL and now I am trying to
port this application to use PostgreSQL.
In PostgreSQL get the error "This resultSet is not updateable."
Any advice on how to solve this?
regards
Kaarle Kaila
-----------------
Connection con =
DriverManager.getConnection("jdbc:postgresql:kalle","kalle","");
Statement stmt = con.createStatement();
String sql = "create table koe (num int primary key,nimi
varchar(255))";
int resu = stmt.executeUpdate(sql);
sql = "insert into koe (num,nimi) values(1,'Kalle')";
resu = stmt.executeUpdate(sql);
sql = "select * from koe where num is null";
ResultSet rs = stmt.executeQuery(sql);
// above command functions OK
rs.moveToInsertRow();
rs.updateInt("num",2);
rs.updateString("nimi","Rita");
rs.insertRow();
// above commands fail in postgreSQL but are OK in other databases
stmt.close();
con.close();
--
Kaarle Kaila
mailto:kaarle(dot)kaila(at)iki(dot)fi
http://www.iki.fi/kaila
tel: 050 3725844
From | Date | Subject | |
---|---|---|---|
Next Message | Dave Cramer | 2002-08-17 17:16:09 | Re: Updateable ResultSet |
Previous Message | Aaron Mulder | 2002-08-17 16:34:27 | Re: oops - Trying to do a simple connect to 7.2.1 DB -- unix |