5 messages in com.mysql.lists.javaRe: show tables
FromSent OnAttachments
David Tonhofer, m-plify S.A.10 Sep 2002 03:32 
Mark Matthews10 Sep 2002 03:59 
Jasper Fontaine10 Sep 2002 05:18 
Luca Lafranchi10 Sep 2002 05:19 
Jasper Fontaine10 Sep 2002 05:35 
Subject:Re: show tables
From:Luca Lafranchi (luca@rohag.ch)
Date:09/10/2002 05:19:38 AM
List:com.mysql.lists.java

Just use a java.sql.DatabaseMetaData object. Give a look at the api docs to see how it works, and try the DatabaseMetaData.getTables(..) method.

A simple example:

java.sql.DatabaseMetaData dbmd = connection.getMetaData(); java.sql.ResultSet tableSet = dbmd.getTables(null,null,null,new String[]{"TABLE"});

Ciao Luca

Jasper Fontaine wrote:

hi all, how do i retrieve a list of all tablenames in the database? i know i can do it with a "show tables" query in MySQL, but i'd like to try to make this db-independent.. thanx! jasper

--------------------------------------------------------------------- Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before posting. To request this thread, e-mail java@lists.mysql.com

To unsubscribe, send a message to the address shown in the List-Unsubscribe header of this message. If you cannot see it, e-mail java@lists.mysql.com instead.

.