Here you can find the source of printExistingTables(Connection conn)
public static void printExistingTables(Connection conn) throws SQLException
//package com.java2s; //License from project: Open Source License import java.sql.Connection; import java.sql.DatabaseMetaData; import java.sql.ResultSet; import java.sql.SQLException; public class Main { public static void printExistingTables(Connection conn) throws SQLException { DatabaseMetaData dbmd = conn.getMetaData(); System.out.println("********************************************"); ResultSet rs = dbmd.getTables(null, null, null, null); while (rs.next()) { System.out.println(rs.getString("TABLE_NAME")); }//from w w w. j a va 2s . com System.out.println("********************************************"); } }