我想获取所有以_tbl结尾的数据库表名,如xyz_tbl、pqr_tbl等。在mysql中使用java.pls帮助我..目前我的查询检索所有表名,但我只想要以_tbl结尾的表名。我的代码是...
public List selectTable() {
List tableNameList= new ArrayList();
try {
DatabaseMetaData dbm = c.conn.getMetaData();
String[] types = {"TABLE"};
c.rs = dbm.getTables(null, null, "%", types);
while (c.rs.next()) {
tableNameList.add(c.rs.getString("TABLE_NAME"));
}
} catch(Exception e) {
System.out.println(e.toString());
}
return tableNameList;
}