Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 54EEA633A79 for ; Wed, 9 Jun 2010 03:09:27 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 64742-05 for ; Wed, 9 Jun 2010 06:09:19 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail63.csoft.net (mail63.csoft.net [205.205.214.4]) by mail.postgresql.org (Postfix) with ESMTP id 047016322D0 for ; Wed, 9 Jun 2010 03:09:19 -0300 (ADT) Received: from mail63.csoft.net (localhost [127.0.0.1]) by mail63.csoft.net (Postfix) with ESMTP id 1C35828414; Wed, 9 Jun 2010 02:09:18 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=csoft.net; h=date:from:to :cc:subject:in-reply-to:message-id:references:mime-version :content-type; s=sel1; bh=4WGqicraBo+0ebQCeO0+nWqOcp0=; b=f8zkXz yp2vBKCd+NBuWUMxH8dy5PfFvbJiIp+cdxucwdLZBZPZVLOhq/CVY0RzP9A7W7Pc xLpkaCDNwgYF+KVYPwpEePKg5emQW+pY2hef31z8SJesZmudddUz5CBj56NSxxlK nltT+qwcHvC6mJ7bQVXapgpopzdQB1pdvNlWg= Received: from leary.csoft.net (leary.csoft.net [205.205.214.5]) by mail63.csoft.net (Postfix) with ESMTP id 0FD9428410; Wed, 9 Jun 2010 02:09:18 -0400 (EDT) Received: by leary.csoft.net (Postfix, from userid 1112) id A9D5DA39F; Wed, 9 Jun 2010 02:09:17 -0400 (EDT) Date: Wed, 9 Jun 2010 02:09:17 -0400 (EDT) From: Kris Jurka X-X-Sender: books@leary.csoft.net To: miguel manzano cc: pgsql-jdbc@postgresql.org Subject: Re: I can't get the database's list In-Reply-To: <1276050127.8267.6.camel@localhost> Message-ID: References: <1276050127.8267.6.camel@localhost> User-Agent: Alpine 2.00 (BSO 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201006/50 X-Sequence-Number: 20620 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