Skip to content

Commit

Permalink
0005053: SQL Explorer not showing triggers from another catalog on
Browse files Browse the repository at this point in the history
MS-SQL
  • Loading branch information
erilong committed Jul 12, 2021
1 parent 937e2fe commit cccbe5b
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 6 deletions.
Expand Up @@ -110,7 +110,7 @@ public <T> ISqlReadCursor<T> queryForCursor(String sql, ISqlRowMapper<T> mapper)
public <T> ISqlReadCursor<T> queryForCursor(String sql, ISqlRowMapper<T> mapper,
IConnectionHandler connectionHandler, Object[] args,
int[] types) {
return queryForCursor(sql, mapper, args, types);
return queryForCursor(sql, mapper, connectionHandler, args, types);
}

public <T> ISqlReadCursor<T> queryForCursor(String sql, ISqlRowMapper<T> mapper, boolean returnLobObjects) {
Expand Down
Expand Up @@ -25,7 +25,7 @@ public void before(Connection connection) {
previousCatalog = connection.getCatalog();
connection.setCatalog(changeCatalog);
} catch (SQLException e) {
log.warn("Unable to switch to catalog '{}': ", changeCatalog, e.getMessage());
log.debug("Unable to switch to catalog '{}': ", changeCatalog, e.getMessage());
if (changeCatalog != null) {
try {
connection.setCatalog(previousCatalog);
Expand Down
Expand Up @@ -375,7 +375,7 @@ public List<Trigger> getTriggers(final String catalog, final String schema,
+ "inner join sys.schemas as SC "
+ "on TAB.schema_id = SC.schema_id "
+ "where TAB.name=? and SC.name=? ";
return sqlTemplate.query(sql, new ISqlRowMapper<Trigger>() {
return sqlTemplate.queryWithHandler(sql, new ISqlRowMapper<Trigger>() {
public Trigger mapRow(Row row) {
Trigger trigger = new Trigger();
trigger.setName(row.getString("name"));
Expand All @@ -397,7 +397,7 @@ public Trigger mapRow(Row row) {
trigger.setMetaData(row);
return trigger;
}
}, tableName, schema);
}, new ChangeCatalogConnectionHandler(catalog), tableName, schema);
}

protected IConnectionHandler getConnectionHandler(String catalog) {
Expand Down
Expand Up @@ -147,7 +147,12 @@ public <T> ISqlReadCursor<T> queryForCursor(String sql, ISqlRowMapper<T> mapper,
int[] types) {
return queryForCursor(sql, mapper, null, args, types, false);
}


public <T> ISqlReadCursor<T> queryForCursor(String sql, ISqlRowMapper<T> mapper, IConnectionHandler connectionHandler, Object[] args,
int[] types) {
return queryForCursor(sql, mapper, connectionHandler, args, types, false);
}

@Override
public <T> ISqlReadCursor<T> queryForCursor(String sql, ISqlRowMapper<T> mapper, boolean returnLobObjects) {
return queryForCursor(sql, mapper, null, null, null, returnLobObjects);
Expand Down
Expand Up @@ -264,7 +264,7 @@ protected void loadChildren(DbTreeNode treeNode) {
}
} catch (Exception ex) {
log.error(ex.getMessage(), ex);
CommonUiUtils.notify(ex);
CommonUiUtils.notify(ex.getMessage(), ex);
}
}

Expand Down

0 comments on commit cccbe5b

Please sign in to comment.