how to test whether a table existed?

Поиск
Список
Период
Сортировка
Искать

how to test whether a table existed?

От:
"Yi Dong" <yrdong@hotmail.com>
Дата:

Hey, I have a simple question to ask, how do you write something like

if a table named "XXX" exits in java?

I read the java.sql api and did abit of research but couldn't find anything 
about it. It just one of those things which take 1 min to explain but 3 
hours to find it on the web so could somebody please give me a hint....

regards

Yi Dong

_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com

Re: how to test whether a table existed?

От:
Dror Matalon <dror@zapatec.com>
Дата:


look at connection.getMetaData();
and dbMetaData.getTables(); 

It'll give you the list of tables.

On Fri, Sep 27, 2002 at 06:17:54AM +0000, Yi Dong wrote:
> 
> Hey, I have a simple question to ask, how do you write something like
> 
> if a table named "XXX" exits in java?
> 
> I read the java.sql api and did abit of research but couldn't find anything 
> about it. It just one of those things which take 1 min to explain but 3 
> hours to find it on the web so could somebody please give me a hint....
> 
> regards
> 
> Yi Dong
> 
> _________________________________________________________________
> Send and receive Hotmail on your mobile device: http://mobile.msn.com
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
> 
> http://archives.postgresql.org

-- 
Dror Matalon
Zapatec Inc
1700 MLK Way
Berkeley, CA 94709
http://www.zapatec.com
FAQ