title: Execute anonymous pl/sql block and get resultset in java
body: <p>I would like to execute the anonymous PL/SQL and need to get the resultset object. I got the code which can be done by using cursors inside the PL/SQL block.</p>
  
  <p>But the PL/SQL block itself will come from the database as text. So I can't edit that PL/SQL block. And it will return only two values whose column names will be same always. It will return list of 2 column combination values.</p>
  
  <p>Here I am giving sample PL/SQL.</p>
  
  <pre><code>BEGIN
  
  RETURN 'select distinct fundname d, fundname r from &lt;table&gt; where condition order by 1';
  
  EXCEPTION
     WHEN OTHERS THEN
      RETURN 'SELECT ''Not Available'' d, ''Not Available'' r FROM dual';
  END;
  </code></pre>
  
  <p>Any reply will be so helpful.</p>