有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

是否可以将异常从java VBean传递到Oracle窗体?

我使用oraclepl/SQL通过Bean区域在我的Oracle表单和JAR之间通信。 在表格中,我有以下代码:

DECLARE
  w_retorno VARCHAR2;
BEGIN
  fbean.Register_Bean( item_name     => 'bl.bean_area'
                     , item_instance => 1
                     , bean_class    => 'br.com.cutrale.conectorged.ConectorGED'); 

  w_retorno := fbean.Invoke_Char( item_name        => 'bl.bean_area'
                              , item_instance    => 1
                              , method_name      => 'upload'
                              , method_arguments => '"' || 
                                                    'teste' || 
                                                    ',' ||  
                                                    'teste' ||
                                                    ',' ||
                                                    'teste' ||
                                                    '"');
END;

我的java应用程序有以下方法

public String upload( String caminho, String aplicacao, String usuario ) throws Exception {

    if (caminho == null || caminho.isEmpty()) {
        throw new Exception("O caminho do arquivo não foi informado.");
    }

    File file = new File(caminho);

    if (!file.exists()) {
        throw new Exception("Arquivo não encontrado: " + caminho);
    }

    VersaoDocumentoDto dto = new GEDService().sendFile(file, usuario);

    return dto.getDocumento().getId();
}

有可能捕获Java应用程序抛出的表单中的异常吗


共 (0) 个答案