Re: I can't get the database's list

Поиск
Список
Период
Сортировка
От Kris Jurka
Тема Re: I can't get the database's list
Дата
Msg-id alpine.BSO.2.00.1006090206001.2333@leary.csoft.net
обсуждение исходный текст
Ответ на I can't get the database's list  (miguel manzano <miguel.miguelmanzano@gmail.com>)
Ответы Re: I can't get the database's list
Список pgsql-jdbc

On Tue, 8 Jun 2010, miguel manzano wrote:

> I try to obtain the database's list in my instalation but when I use :
>
> System.out.println("Driver : ");
>         System.out.println("   " + md.getDatabaseProductName() );
>         System.out.println("   " + md.getDatabaseProductVersion() );
>         ResultSet catalogRs = md.getCatalogs();
>
>         while ( catalogRs.next() ){
>
>            System.out.println("Catalog " + catalogRs.getString(1));
>            ResultSet tableRs =
> md.getTables(catalogRs.getString(1),"%","%",(String []) null);
>            }
>        }
> I just got only the name of the database at I have conected but the
> another databases didn't figure in the list.

The JDBC driver avoids returning all the databases on the server because
it cannot access them.  It can only access the current database so that is
all it returns from getCatalogs.  We made this decision intentionally to
handle the exact situation that your next getTables call reveals.  If we
returned other databases in getCatalogs, people would try to use them in
other database metadata calls which would not work.

Kris Jurka


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

Предыдущее
От: miguel manzano
Дата:
Сообщение: I can't get the database's list
Следующее
От: Kris Jurka
Дата:
Сообщение: Re: IllegalArgumentException in batch execution