Re: JDBC

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: JDBC
Дата
Msg-id CAKFQuwZJ8qLvKyX-JrFbysjHuWSDDFaMpbjXTGe-zhtOkDn2JA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: JDBC  (Chuck Davis <cjgunzel@gmail.com>)
Ответы Re: JDBC  (Chuck Davis <cjgunzel@gmail.com>)
Список pgsql-jdbc
On Sunday, June 10, 2018, Chuck Davis <cjgunzel@gmail.com> wrote:
If I try to return a ResultSet the class will not compile with the
message that boolean cannot be converted to a ResultSet.  And this is
in synch with the documentation that states the "exists" subquery will
return a boolean -- not a ResultSet.


The PostgreSQL documentation doesn't talk in terms JDBC, the Oracle JDBC API specification covers that.


JDBC uses ResultSet to return the results of queries.
 
There are a number of sites that indicate the statement is the way to
find out if a table exists.  Are the sites for an older version of PG?
 I'm running on 10.

This really has nothing to do with PostgreSQL specifically, you are failing to use the JDBC API correctly.  In the short term you should probably just use "executeQuery" instead of "execute" since you are in fact executing a query that returns a ReaultSet (which is exactly what execute's true boolean result is telling you).

David J.

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

Предыдущее
От: Chuck Davis
Дата:
Сообщение: Re: JDBC
Следующее
От: Chuck Davis
Дата:
Сообщение: Re: JDBC