Re: "could not determine data type of parameter" with timestamp
От | David G. Johnston |
---|---|
Тема | Re: "could not determine data type of parameter" with timestamp |
Дата | |
Msg-id | CAKFQuwarUwHAX6Zss4Cqdu2i8Y4nsTfRpz9x9atgudnfia_aew@mail.gmail.com обсуждение исходный текст |
Ответ на | "could not determine data type of parameter" with timestamp (Rémi Aubel <remi.aubel@gmail.com>) |
Ответы |
Re: "could not determine data type of parameter" with timestamp
|
Список | pgsql-jdbc |
Hello,I know my problem has already been answered in this list (https://www.postgresql.org/message-id/CA% 2BxsaB0EMDaNek0Oky9c17_8UX3- epWVP11%2BvTNgrAPoY2s9FA% 40mail.gmail.com), but it was a long time ago and I would like to know if any other solution exists now.
Not that I am aware.
But this workaround is not really useful for me, because my application uses generated (dynamic) queries and targets multiple database types (not only PosgreSQL). So, when I know the targeted database, I do not know my parameter types anymore.
I'd probably perform the null test in Java and pass the true/false boolean result along to the query:
SELECT * FROM my_table WHERE ?::bool;
ps.setBoolean(1, tsvar = null); //my Java is rusty but you get the idea.
That should work in any database.
David J.
В списке pgsql-jdbc по дате отправления: