Hi,
I'd like to retrieve all table names from a database schema, and, if possible, get all table starting with a specified prefix.
I tried using JDBC's connection.getMetaData().getTables() but it didn't work at all.
Connection jdbcConnection = DriverManager.getConnection("", "", "");
DatabaseMetaData dmd = jdbcConnection.getMetaData();
ResultSet tables = dmd.getTables(jdbcConnection.getCatalog(), null, "TAB_%", null);
for (int i = 0; i < tables.getMetaData().getColumnCount(); i++) {
System.out.println("table = " + tables.getMetaData().getTableName(i));
}
Could someone help me on this ?
Thanks, and sorry for the noob question.