Re: [GENERAL] Resultset problem or BUG !

Поиск
Список
Период
Сортировка
От Oliver Jowett
Тема Re: [GENERAL] Resultset problem or BUG !
Дата
Msg-id 411B02FE.6060600@opencloud.com
обсуждение исходный текст
Ответ на Re: [GENERAL] Resultset problem or BUG !  (Elie Nacache <elie_nacache@yahoo.com>)
Ответы Re: [GENERAL] Resultset problem or BUG !
Список pgsql-jdbc
Elie Nacache wrote:

>     this.sqlDatas.moveToInsertRow();
>     this.updateColumns();
>     this.sqlDatas.insertRow();

The JDBC javadoc implies that calling insertRow() leaves the resultset
on the insert row. This is what the driver implements.

>     this.sqlLineNumber = this.sqlDatas.getRow(); // INFO >> return 0

As the javadoc says, getRow() returns 0 if there is no current row.
You're on the insert row so there is no current row.

>     INFO >> At this step there is no commit
>     INFO >> Second step update the row after collecting updated info
>
>     this.sqlDatas.absolute(this.sqlLineNumber); // INFO >> throw the
>     exception

What is the exception you see?

The current development driver (see jdbc.postgresql.org) will treat
absolute(0) as if you'd called beforeFirst(). Older drivers might do
something different.

>     this.updateColumns();
>     this.sqlDatas.updateRow();
>     INFO >> If I fix the sqlLineNumber to 1 and force the absolute(1)
>     then no Execption is thrown but the modification is not seen in the
>     table.

Looking at the driver source, it looks like the newly inserted row is
appended to the resultset, so you should find it at the end of the
resultset not the start. (I don't think making this assumption is
portable, though).

-O

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

Предыдущее
От: Elie Nacache
Дата:
Сообщение: Re: [GENERAL] Resultset problem or BUG !
Следующее
От: Guido Fiala
Дата:
Сообщение: updating Arrays