| От | Jon Barnett |
|---|---|
| Тема | JDBC next() method |
| Дата | |
| Msg-id | 01BE86CA.23683420.jbarnett@pobox.com обсуждение |
| Ответы |
Re: [INTERFACES] JDBC next() method
|
| Список | pgsql-interfaces |
I'm not quite sure about the correct operation of the JDBC next() method.
Suppose I have the following code:
queryResult = dbStatement.executeQuery("select max(history_id) from history");
if (queryResult.next())
nextID = queryResult.getLong(1) + 1;
else
nextID = 0;
With the postgresql JDBC driver, the minimum value for nextID is 1, even if the
history table is empty. I had expected that an empty result set would be
returned if the history table is empty (0 rows returned for the select), and
queryResult.next() would be false. Is this an incorrect interpretation on my
part?
Thanks,
JonB.
В списке pgsql-interfaces по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера