|
|
|
@ -1,14 +1,16 @@
|
|
|
|
|
package com.fr.design.data.datapane.connect; |
|
|
|
|
|
|
|
|
|
import com.fr.data.impl.Connection; |
|
|
|
|
import com.fr.data.impl.JDBCDatabaseConnection; |
|
|
|
|
import com.fr.design.gui.frpane.LoadingBasicPane; |
|
|
|
|
import com.fr.design.gui.ilist.ListModelElement; |
|
|
|
|
import com.fr.design.layout.FRGUIPaneFactory; |
|
|
|
|
import com.fr.file.ConnectionConfig; |
|
|
|
|
import com.fr.general.NameObject; |
|
|
|
|
import com.fr.license.database.DatabaseTypeValidateUtil; |
|
|
|
|
import com.fr.license.exception.DataBaseNotSupportedException; |
|
|
|
|
import com.fr.stable.Nameable; |
|
|
|
|
import com.fr.workspace.WorkContext; |
|
|
|
|
import com.fr.workspace.server.database.DataBaseTypeOperator; |
|
|
|
|
|
|
|
|
|
import javax.swing.JPanel; |
|
|
|
|
import java.awt.BorderLayout; |
|
|
|
@ -75,7 +77,14 @@ public class ConnectionManagerPane extends LoadingBasicPane implements Connectio
|
|
|
|
|
Nameable wrapper = selectedValue.wrapper; |
|
|
|
|
try { |
|
|
|
|
Connection connection = (Connection) ((NameObject) wrapper).getObject(); |
|
|
|
|
DatabaseTypeValidateUtil.validateDatabaseType(connection.getDriver(), connection.feature()); |
|
|
|
|
// 仅校验jdbc连接,其他插件数据连接不进行校验
|
|
|
|
|
if (connection instanceof JDBCDatabaseConnection) { |
|
|
|
|
DataBaseNotSupportedException exception = WorkContext.getCurrent().get(DataBaseTypeOperator.class).validateDatabaseType(connection.getDriver(), connection.feature()); |
|
|
|
|
if (exception != null) { |
|
|
|
|
throw exception; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} catch (DataBaseNotSupportedException e) { |
|
|
|
|
// 仅抛出数据库类型不支持异常
|
|
|
|
|
throw e; |
|
|
|
|