I have a set of tables [A,B,C,D] in MySQL Database
The dependency is as follows B->C->A and D->A that is, A has a PrimaryKey , C has a foreign key which points A\'s Pri
I actually just figured this out for a recent school project. There are a few ways to do it such as using ResultSetMetaData and setting up a loop with an exception listener; however the quickest way is what I have below. read is a Statement object and results is a ResultSet object. Using this you should be able to write a loop that cycles through all of the names. I think this method is better because it returns a ResultSet of just the table names. If you add the modifer FULL, a second column will appear describing what kind of tables each are such as base table. Hope this helps!
read.execute("SHOW TABLES IN your_database_name;");
results = read.getResultSet();
results.first();
System.out.println(results.getString(1));
MySQL Show Statement