Exception: No primary keys?

From: "Han" <zhouhanok(at)vip(dot)sina(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org <pgsql-jdbc(at)postgresql(dot)org>
Subject: Exception: No primary keys?
Date: 2002-12-02 08:43:31
Message-ID: 20021202084258.99E794758E6@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

pgsql-jdbc

A simplest test failed when I use postgresql and pgsql-jdbc driver which were build from postgresql7.3b5 source code.
The test code is:
..
14 try{
15 Class.forName(strDrv);
16 conn = DriverManager.getConnection(strUrl, "postgl", "");
17 stmt = conn.createStatement();
18 rs = stmt.executeQuery(strSql);
19 while (rs.next())
20 {
21 System.out.println(rs.getString(1));
22 }
23 //rs.beforeFirst();
24 while (rs.previous())
25 {
26 System.out.println(rs.getString(1));
27 }
28 rs.moveToInsertRow();
29 rs.updateInt("a", 100);
30 rs.insertRow();
31 } catch(Exception e){
32 System.out.println(e.toString());
33 }

The table "test" has only two columns(a int, b varchar) and no primary keys.
The error message is: No primary keys.
It's all right with line 28,29 and 30 commented out.
It will also succedd when the table "test" has a primary key.
Can you tell me why?
My environment is:
redhat 7.3
j2sdk1.4.1_01
ant1.5.1

Thanks and regards,
        

        Han
        zhouhanok(at)vip(dot)sina(dot)com
          2002-12-02

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Martin Ekerå 2002-12-02 12:25:13 PostgreSQL JDBC Driver License Inquiry
Previous Message Grzegorz Gałęzowski 2002-12-02 07:54:45 J2ME