

---------- Forwarded message ----------
Date: Mon, 21 Aug 2000 18:33:39 +0300 (EEST)
From: sergiy grigoriev <serg@localhost.localdomain>
To: pgsql-questions@postgresql.org
Subject: postgresql-java (fwd)




		Hi !
	While developing a Java GUI front-end to Postgresql I've faced the
next problem:

	I want my program to 
  1. list all the available tables in the database					
  2. Show the structure of the chosen table.
 
 1.The first task is OK,it can easily be done by inspecting  the PG_TABLES
 2. Please tell me how can I determine the structure of the table
 (field names and types) using Postgres JDBC Driver in order to
complete the second task.

	Thank you in advance for your reply.
  
	




Tue, 22 Aug 2000 07:03:58 +0300 (EEST)
sergiy grigoriev <grygoriev@yahoo.com>
postgresql-java (fwd)
>   1. list all the available tables in the database
>   2. Show the structure of the chosen table.

You might want to inspect the code for psql to see how this is done.
"\d" and "\d tablename" seem to do what you want.

                   - Thomas

Tue, 22 Aug 2000 06:44:10 +0000
Thomas Lockhart <lockhart@alumni.caltech.edu>
Re: postgresql-java (fwd)
sergiy grigoriev wrote:
> 
> ---------- Forwarded message ----------
> Date: Mon, 21 Aug 2000 18:33:39 +0300 (EEST)
> From: sergiy grigoriev <serg@localhost.localdomain>
> To: pgsql-questions@postgresql.org
> Subject: postgresql-java (fwd)
> 
>                 Hi !
>         While developing a Java GUI front-end to Postgresql I've faced the
> next problem:
> 
>         I want my program to
>   1. list all the available tables in the database
>   2. Show the structure of the chosen table.
> 
>  1.The first task is OK,it can easily be done by inspecting  the PG_TABLES
>  2. Please tell me how can I determine the structure of the table
>  (field names and types) using Postgres JDBC Driver in order to
> complete the second task.
> 
>         Thank you in advance for your reply.
> 
> 
You want to use the JDBC DatabaseMetaData class. In contains the the
methods getTables() and getColumns(). 
Refer to the JDBC API at
http://java.sun.com/products//jdk/1.2/docs/guide/jdbc/index.html
-- 
Dave Smith
Candata Systems Ltd.
(416) 493-9020
dave@candata.com

Tue, 22 Aug 2000 08:25:03 -0400
Dave Smith <dave@candata.com>
Re: postgresql-java (fwd)