List Of dataBase Tables...

Is it possible to get a list of all the tables in a DataBase?I think it involves the getMetaData() method but I am not quite shure how to use it...Thanks.Dan.
[193 byte] By [banad] at [2007-9-26 1:27:27]
# 1

Connection conn2_;

DatabaseMetaData md2=conn2_.getMetaData();

ResultSet Rs=md.getSchemas();

ResultSet Rs2;

String tempString = "";

String resultString = "";

String sschema;

while(Rs.next())

{

sschema = Rs.getString(1);

System.out.println("Searching Schema " + sschema + "\n");

Rs2 = md2.getTables(null,sschema, "%",null);

while(Rs2.next())

{

tempString = Rs2.getString(3) + " ";

tempString+= Rs2.getString(4);

resultString+= tempString + "\n";

}

System.out.println(resultString);

}

leewaqar at 2007-6-29 1:11:43 > top of Java-index,Archived Forums,Java Programming...