Re: how to resolve org.postgresql.util.PSQLException: ResultSet notpositioned properly, perhaps you need to call next.

Поиск
Список
Период
Сортировка
От Karen Goh
Тема Re: how to resolve org.postgresql.util.PSQLException: ResultSet notpositioned properly, perhaps you need to call next.
Дата
Msg-id 522221901.1676873.1567648109451@mail.yahoo.com
обсуждение исходный текст
Ответ на Re: how to resolve org.postgresql.util.PSQLException: ResultSet notpositioned properly, perhaps you need to call next.  (Rob Sargent <robjsargent@gmail.com>)
Список pgsql-jdbc
Not at all. As mentioned, I could print out the queried subectNames, at the ide and at the database. But, I can’t anymore.

However, I need to deal with Tomcat problem first to give me a real reflection of my code error.


Sent from Yahoo Mail for iPhone

On Thursday, September 5, 2019, 12:39 AM, Rob Sargent <robjsargent@gmail.com> wrote:


As I said last time, I'm not an "expert".

subjectNames is declared as an array.
In your "for" loop you will be doing ps2.setArray(2, array); multiple
times depending on the number of subjects contained in subjectNames.

I suspect the query is failing and as there is no try .. catch block to
trap the SQLException, this is not reported back to your code.

If you alter the postgresql.conf to log all SQL statements, restart,
run your test again, look in the log file, it will show the passed
parameter values. You can then verify that that the array passed as the
second parameter is correct.

HTH,
Robert
Relieved am I that other’s could see that I was not doubting the OP wrote the code in question.  I do consider myself a Java programmer (expert is a trickier question).

We do need to see the entire routine (I think that might be doPost()).  If that’s more than 100 lines I suggest a refactor first. Have the doPost() call a method which does nothing but the desired interaction. 

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

Предыдущее
От: Rob Sargent
Дата:
Сообщение: Re: how to resolve org.postgresql.util.PSQLException: ResultSet notpositioned properly, perhaps you need to call next.
Следующее
От: Karen Goh
Дата:
Сообщение: Re: how to resolve org.postgresql.util.PSQLException: ResultSet notpositioned properly, perhaps you need to call next.