|
|
@ -7,7 +7,6 @@ import com.fr.data.driver.util.JarFileParseUtil; |
|
|
|
import com.fr.data.impl.Connection; |
|
|
|
import com.fr.data.impl.Connection; |
|
|
|
import com.fr.data.impl.JDBCDatabaseConnection; |
|
|
|
import com.fr.data.impl.JDBCDatabaseConnection; |
|
|
|
import com.fr.data.impl.JNDIDatabaseConnection; |
|
|
|
import com.fr.data.impl.JNDIDatabaseConnection; |
|
|
|
import com.fr.data.operator.DataOperatorProvider; |
|
|
|
|
|
|
|
import com.fr.data.security.ssl.impl.NormalSsl; |
|
|
|
import com.fr.data.security.ssl.impl.NormalSsl; |
|
|
|
import com.fr.data.solution.ExceptionSolutionSelector; |
|
|
|
import com.fr.data.solution.ExceptionSolutionSelector; |
|
|
|
import com.fr.data.solution.entity.DriverPage; |
|
|
|
import com.fr.data.solution.entity.DriverPage; |
|
|
@ -22,6 +21,7 @@ import com.fr.design.gui.ilable.UILabel; |
|
|
|
import com.fr.design.i18n.Toolkit; |
|
|
|
import com.fr.design.i18n.Toolkit; |
|
|
|
import com.fr.design.layout.FRGUIPaneFactory; |
|
|
|
import com.fr.design.layout.FRGUIPaneFactory; |
|
|
|
import com.fr.design.utils.gui.GUICoreUtils; |
|
|
|
import com.fr.design.utils.gui.GUICoreUtils; |
|
|
|
|
|
|
|
import com.fr.file.ConnectionService; |
|
|
|
import com.fr.log.FineLoggerFactory; |
|
|
|
import com.fr.log.FineLoggerFactory; |
|
|
|
import com.fr.rpc.ExceptionHandler; |
|
|
|
import com.fr.rpc.ExceptionHandler; |
|
|
|
import com.fr.rpc.RPCInvokerExceptionInfo; |
|
|
|
import com.fr.rpc.RPCInvokerExceptionInfo; |
|
|
@ -429,14 +429,14 @@ public abstract class DatabaseConnectionPane<E extends com.fr.data.impl.Connecti |
|
|
|
// 返回连接结果
|
|
|
|
// 返回连接结果
|
|
|
|
DriverPage.updateCache(); |
|
|
|
DriverPage.updateCache(); |
|
|
|
final Exception[] exception = new Exception[1]; |
|
|
|
final Exception[] exception = new Exception[1]; |
|
|
|
WorkContext.getCurrent().get(DataOperatorProvider.class, new ExceptionHandler() { |
|
|
|
WorkContext.getCurrent().get(ConnectionService.class, new ExceptionHandler() { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public Object callHandler(RPCInvokerExceptionInfo exceptionInfo) { |
|
|
|
public Object callHandler(RPCInvokerExceptionInfo exceptionInfo) { |
|
|
|
// 正常调用发生的异常也会被捕获,因此需要对异常类型进行判断,如果是NoSuchMethodException 就要去调用 testConnection
|
|
|
|
// 正常调用发生的异常也会被捕获,因此需要对异常类型进行判断,如果是NoSuchMethodException 就要去调用 testConnection
|
|
|
|
// 如果不是 NoSuchMethodException 保存下异常上下文
|
|
|
|
// 如果不是 NoSuchMethodException 保存下异常上下文
|
|
|
|
// 两种情况下异常都需要抛出
|
|
|
|
// 两种情况下异常都需要抛出
|
|
|
|
if (exceptionInfo.getException() instanceof NoSuchMethodException) { |
|
|
|
if (exceptionInfo.getException() instanceof NoSuchMethodException) { |
|
|
|
if (!WorkContext.getCurrent().get(DataOperatorProvider.class).testConnection(database)) { |
|
|
|
if (!WorkContext.getCurrent().get(ConnectionService.class).test(database)) { |
|
|
|
exception[0] = new Exception(Toolkit.i18nText("Fine-Design_Description_Of_Test_Connection")); |
|
|
|
exception[0] = new Exception(Toolkit.i18nText("Fine-Design_Description_Of_Test_Connection")); |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
@ -444,7 +444,7 @@ public abstract class DatabaseConnectionPane<E extends com.fr.data.impl.Connecti |
|
|
|
} |
|
|
|
} |
|
|
|
return null; |
|
|
|
return null; |
|
|
|
} |
|
|
|
} |
|
|
|
}).testConnectionWithException(database); |
|
|
|
}).test(database); |
|
|
|
if (exception[0] != null) { |
|
|
|
if (exception[0] != null) { |
|
|
|
throw exception[0]; |
|
|
|
throw exception[0]; |
|
|
|
} |
|
|
|
} |
|
|
|