Browse Source

REPORT-88826 设计器新增不支持的数据库类型未受到限制

封装DataBaseNotSupportedException用于rpc调用
release/11.0
Leo.Qin 2 years ago
parent
commit
af372c267f
  1. 7
      designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionManagerPane.java

7
designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionManagerPane.java

@ -11,6 +11,7 @@ import com.fr.license.exception.DataBaseNotSupportedException;
import com.fr.stable.Nameable; import com.fr.stable.Nameable;
import com.fr.workspace.WorkContext; import com.fr.workspace.WorkContext;
import com.fr.workspace.server.database.DataBaseTypeOperator; import com.fr.workspace.server.database.DataBaseTypeOperator;
import com.fr.workspace.server.database.DatabaseExceptionBean;
import javax.swing.JPanel; import javax.swing.JPanel;
import java.awt.BorderLayout; import java.awt.BorderLayout;
@ -79,9 +80,9 @@ public class ConnectionManagerPane extends LoadingBasicPane implements Connectio
Connection connection = (Connection) ((NameObject) wrapper).getObject(); Connection connection = (Connection) ((NameObject) wrapper).getObject();
// 仅校验jdbc连接,其他插件数据连接不进行校验 // 仅校验jdbc连接,其他插件数据连接不进行校验
if (connection instanceof JDBCDatabaseConnection) { if (connection instanceof JDBCDatabaseConnection) {
DataBaseNotSupportedException exception = WorkContext.getCurrent().get(DataBaseTypeOperator.class).validateDatabaseType(connection.getDriver(), connection.feature()); DatabaseExceptionBean bean = WorkContext.getCurrent().get(DataBaseTypeOperator.class).validateDatabaseType(connection.getDriver(), connection.feature());
if (exception != null) { if (bean != null) {
throw exception; throw new DataBaseNotSupportedException(bean.getErrorMsg());
} }
} }

Loading…
Cancel
Save