提交 d309977c 编写于 作者: J jurgen

RSV tabs naming fix

Result set name support

Former-commit-id: a39a723c
上级 9f729f4a
......@@ -45,5 +45,7 @@ public interface DBCResultSet extends DBPObject
DBCResultSetMetaData getResultSetMetaData() throws DBCException;
String getResultSetName() throws DBCException;
void close();
}
......@@ -206,6 +206,19 @@ public class JDBCResultSetImpl implements JDBCResultSet {
return metaData;
}
@Override
public String getResultSetName() throws DBCException {
if (this.original == null) {
return null;
}
try {
return original.getCursorName();
}
catch (SQLException e) {
throw new DBCException(e, session.getDataSource());
}
}
@Override
public ResultSetMetaData getMetaData()
throws SQLException
......
......@@ -116,6 +116,11 @@ public class LocalResultSet implements DBCResultSet
};
}
@Override
public String getResultSetName() throws DBCException {
return null;
}
@Override
public void close()
{
......
......@@ -538,6 +538,15 @@ public class SQLQueryJob extends DataSourceJob
}
}
}
/*
if (CommonUtils.isEmpty(sourceName)) {
try {
sourceName = resultSet.getResultSetName();
} catch (DBCException e) {
log.debug(e);
}
}
*/
if (!CommonUtils.isEmpty(sourceName)) {
result.setSourceEntity(sourceName);
}
......
......@@ -1032,7 +1032,7 @@ public class SQLEditor extends SQLEditorBase
//boolean firstResultSet = queryProcessors.isEmpty();
int tabIndex = Math.max(resultTabs.getItemCount() - 2, 0);
int queryIndex = queryProcessors.indexOf(queryProcessor);
int queryIndex = queryProcessors.indexOf(queryProcessor) + 1;
tabItem = new CTabItem(resultTabs, SWT.NONE, tabIndex);
String tabName = CoreMessages.editors_sql_data_grid;
if (resultSetNumber > 0) {
......
......@@ -156,6 +156,11 @@ public class WMIResultSet implements DBCResultSet, DBCResultSetMetaData, DBCEnti
return this;
}
@Override
public String getResultSetName() throws DBCException {
return null;
}
@Override
public void close()
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册