Search in sources :

Example 1 with ChangeCatalogConnectionHandler

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()]));
}
Also used : StringMapper(org.jumpmind.db.sql.mapper.StringMapper) ChangeCatalogConnectionHandler(org.jumpmind.db.sql.ChangeCatalogConnectionHandler) ArrayList(java.util.ArrayList)

Aggregations

ArrayList (java.util.ArrayList)1 ChangeCatalogConnectionHandler (org.jumpmind.db.sql.ChangeCatalogConnectionHandler)1 StringMapper (org.jumpmind.db.sql.mapper.StringMapper)1