mycat1.6.74调用Oracle存储过程返回结果集

 

      try (PreparedStatement statement = connection.prepareStatement(
"/*#mycat: sql=sql=SELECT 1 FROM travelrecord where id=1 , list_fields='@out1'*/call pro_data (@out1);select @out1"
)) {
                    statement.execute();
                    ResultSet resultSet = statement.getResultSet();
                    while (resultSet.next()){
                      String string = resultSet.getString(1);
                      System.out.println(string+":"+string);
                    }
    
                  }

list_fields='@out1'指定该参数是结果集类型,经过测试暂时只支持一个

@out1是结果集的out参数名

/*#mycat: sql=SELECT 1 FROM travelrecord where id=1 , list_fields='@out1'*/set @id = 1; call pro_data3 (@id,@out1);select @out1";

带in参数和out参数的例子

 

你可能感兴趣的:(Mycat)