On Mon, 16 Aug 1999, Mark Dzmura wrote:
> Thanks for your incisive replies to my earlier query.. I still have
> two questions. (I wouldn't ask them if I was able to find the answers
> elsewhere, but I haven't found them in the JDBC 1.2 or 2.0 specs, or
> the 2 books in my possession which give some coverage to JDBC...)
> >From JDBC,
> 1. Is it possible to enumerate or discover the databases in a running
Not using any standard JDBC method. However, you could do what psql does,
and that is connect to the template1 database (which always exists), and
then issue a query on the system tables.
> 2. Is it possible to enumerate or discover the tables in a database??
Yes. Once you have a Connection, get a DatabaseMetaData object (using
getMetaData() ), and use the getTables() method.
Peter T Mount peter(at)retep(dot)org(dot)uk
Main Homepage: http://www.retep.org.uk
PostgreSQL JDBC Faq: http://www.retep.org.uk/postgres
Java PDF Generator: http://www.retep.org.uk/pdf
In response to
pgsql-interfaces by date
|Next:||From: Ansley, Michael||Date: 1999-08-17 11:39:54|
|Subject: RE: [INTERFACES] A few more JDBC meta-data questions...|
|Previous:||From: D'Arcy J.M. Cain||Date: 1999-08-17 11:19:00|
|Subject: Re: [INTERFACES] A few more JDBC meta-data questions...|