No Primary Keys (pg7.4.2 on SLES9)

From: "Vidas Makauskas" <v(dot)makauskas(at)pzu(dot)lt>
To: <pgsql-jdbc(at)postgresql(dot)org>
Subject: No Primary Keys (pg7.4.2 on SLES9)
Date: 2006-04-03 08:30:00
Message-ID: 000301c656f8$cc3dd400$8400010a@pzu.lt
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Hi,

I get error NO PRIMARY KEY from prs.moveToInsertRow();

Postgres 7.4.2 on with /usr/share/pgsql/pg73b1jdbc3.jar

All packets from the same Suse Standard Enterprise Server 9 CD's.

Bellow full test.java source.

Best regards

import java.sql.*;

public class

testas

{

private static Connection pg;

public static void

main(String [] args)

{

try {

Class.forName("org.postgresql.Driver").newInstance();

}

catch (Exception e) {

}

try {

pg =
DriverManager.getConnection("jdbc:postgresql://192.168.2.3/db","vidas","");

Statement st = pg.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,
ResultSet.CONCUR_UPDATABLE);

st.executeUpdate("CREATE TABLE public.testas (loid integer PRIMARY KEY)
WITHOUT OIDS");

ResultSet prs = st.executeQuery("SELECT p.* FROM public.testas p");

//prs.next();

prs.moveToInsertRow();

//System.out.println(prs.getConcurrency());

}

catch (SQLException e) {

System.out.println("err: "+e);

e.printStackTrace();

}

}

}

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message João Paulo Ribeiro 2006-04-03 09:24:06 Re: Behaviour of setAutoCommit may not be completely correct.
Previous Message Philip Yarra 2006-04-03 01:16:56 Re: 25P02, current transaction is aborted, commands ignored