Re: Detecting if a table in a database already exists ?

From: Chas Douglass (cdouglas_at_nospam.oz.net)
Date: 10/12/04


Date: Tue, 12 Oct 2004 21:42:34 -0000

t_meining@hotmail.com (Thorsten Meininger) wrote in
news:ckh7eh$1nk$03$1@news.t-online.com:

> Sorry for this newbie question:
> How do I find out from a java source if a table in a database already
> exists?
>
> I cannot believe that I have to execute a SELECT statement and if
> there is an exception I know that the table does not exist. But this
> is a really inconvenient solution. There must be a direct request
> statement.
>
> Thorsten
>
>

I am not an sql expert.

I don't believe this is standard sql, but the database I use (mckoi) has a
"SHOW TABLES" statement that returns a ResultSet of table names.

You should check the documentation for the database you use. This sort of
meta-data should be available somewhere.

Chas Douglass



Relevant Pages