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

From: Darren Davison (no.spam_at_here.please)
Date: 10/13/04


Date: Tue, 12 Oct 2004 23:38:10 +0100

Thorsten Meininger wrote:

> 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.

get the DatabaseMetaData from your connection. See it's JavaDoc for
capabilities.

-- 
darren@             public key
davison|uk.net      #DD356B0D


Relevant Pages