use of org.jumpmind.db.sql.ChangeCatalogConnectionHandler in project symmetric-ds by JumpMind.
the class MsSqlDdlReader method getTableNames.
@Override
public List<String> getTableNames(final String catalog, final String schema, final String[] tableTypes) {
StringBuilder sql = new StringBuilder("select \"TABLE_NAME\" from \"INFORMATION_SCHEMA\".\"TABLES\" where \"TABLE_TYPE\"='BASE TABLE'");
List<Object> args = new ArrayList<Object>(2);
if (isNotBlank(catalog)) {
sql.append(" and \"TABLE_CATALOG\"=?");
args.add(catalog);
}
if (isNotBlank(schema)) {
sql.append(" and \"TABLE_SCHEMA\"=?");
args.add(schema);
}
return platform.getSqlTemplate().queryWithHandler(sql.toString(), new StringMapper(), new ChangeCatalogConnectionHandler(catalog), args.toArray(new Object[args.size()]));
}
Aggregations