Re: Multiple Statement result set problem with PreparedStatements ?

Поиск
Список
Период
Сортировка
От Lenard, Rohan (Rohan)
Тема Re: Multiple Statement result set problem with PreparedStatements ?
Дата
Msg-id 2773CAC687FD5F4689F526998C7E4E5F1EF340@au3010avexu1.global.avaya.com
обсуждение исходный текст
Ответ на Multiple Statement result set problem with PreparedStatements ?  ("Lenard, Rohan (Rohan)" <rlenard@avaya.com>)
Список pgsql-jdbc
I have one but it relies on particular tables existing - if I get a few
minutes I too will simplify it to cause it ..

Rohan
| -----Original Message-----
| From: Oliver Jowett [mailto:oliver@opencloud.com]
| Sent: Thursday, July 14, 2005 12:04 PM
| To: Lenard, Rohan (Rohan)
| Cc: pgsql-jdbc@postgresql.org
| Subject: Re: [JDBC] Multiple Statement result set problem
| with PreparedStatements ?
|
| Lenard, Rohan (Rohan) wrote:
| > What I'm trying to do is do 2 inserts and get the resultant
| key values
| > from the 2 inserts - i.e. effectively the row indexes (there are
| > separate sequences for the pkey for each table, so the
| currval() gives
| > the key of the insert for that table.
| >
| > This SQL works fine from any command line interface to the
| DB - giving
| > the expected results.
| >
|
| > However through the JDBC driver, I don't get any results
| with a select
| > involving the 2 seqs, but if I choose just one I do !!.
|
| That is weird.
|
| I will try to find time to put together a selfcontained
| testcase later on (you could speed this up by sending me one :)
|
| > BTW - The followup analysis below is flawed.
| >
| > With this SQL the driver always returns false for the
| execute() thus
| > taking the getMoreResults() path & there are never results for the
| > INSERT (at least not easily obtainable via the API in a
| generic way).
|
| Sorry -- not thinking there :)
|
| What I'd expect to see is this sequence:
|
|   execute() returns false (no resultset for this result)
|   getUpdateCount() returns 1 (1 row inserted)
|   getMoreResults() returns false (no resultset for this result)
|   getUpdateCount() returns 1 (1 row inserted)
|   getMoreResults() returns true (resultset present)
|   getResultSet() returns an appropriate resultset for the SELECT
|   getMoreResults() returns false (no resultset for this result)
|   getUpdateCount() returns -1 (no more results)
|
| Your code seems to be expecting something different..
|
| -O
|

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

Предыдущее
От: Oliver Jowett
Дата:
Сообщение: Re: Multiple Statement result set problem with PreparedStatements
Следующее
От: Oliver Jowett
Дата:
Сообщение: Re: Multiple Statement result set problem with PreparedStatements