Getting oid after insert

Поиск
Список
Период
Сортировка
От Zak McGregor
Тема Getting oid after insert
Дата
Msg-id 20030828041948.57675557.zak@mighty.co.za
обсуждение исходный текст
Ответы Re: Getting oid after insert
Список pgsql-jdbc
Hi all

I am struggling to get the following code bit to work. It is supposed to be part
of getting the oid of the last insert. Can anyone see what I'm doing wrong
please? (Apart from using Java I mean....)

Thanks
        Statement stmt=conn.createStatement();
        stmt.executeUpdate(sqlStatement);
        org.postgresql.ResultSet result =
(org.postgresql.ResultSet)stmt.getResultSet();
        String statusString =result.getStatusString();
        System.out.println( "Status string returned: "+statusString );

I get the following error:

***Exception:
java.lang.NullPointerException
java.lang.NullPointerException
        at celerity.DBase.executeSQL(DBase.java:82)
        at DBTest.main(DBTest.java:16)


it does compile fine. Removing all the above lines and leaving just this:
        Statement stmt=conn.createStatement();
        stmt.executeUpdate(sqlStatement);

inserts the rows fine.


Thanks

Ciao

Zak

В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Tim McAuley
Дата:
Сообщение: Re: Issues with calling stored prcedures
Следующее
От: Fernando Nasser
Дата:
Сообщение: Re: Java not running under Linux