title: How to get all table names from a database?
body: <p>I'd like to retrieve all table names from a database schema, and, if possible, get all table starting with a specified prefix. </p>
  
  <p>I tried using JDBC's <code>connection.getMetaData().getTables()</code> but it didn't work at all.</p>
  
  <pre><code>Connection jdbcConnection = DriverManager.getConnection("", "", "");
  DatabaseMetaData m = jdbcConnection.getMetaData();
  ResultSet tables = m.getTables(jdbcConnection.getCatalog(), null, "TAB_%", null);
  for (int i = 0; i &lt; tables.getMetaData().getColumnCount(); i++) {
     System.out.println("table = " + tables.getMetaData().getTableName(i));
  }
  </code></pre>
  
  <p>Could someone help me on this?</p>