title: How to get a result out of a pl/sql function in Netbeans
body: <p>I have a function (not a procedure) in my Oracle database.
  This function looks like:</p>
  
  <pre><code>CREATE OR REPLACE FUNCTION GETTOTAL(v_user_id IN NUMBER)
  RETURN NUMBER
  AS
      v_result number := 0;
  BEGIN
      SELECT SUM(DAY1+DAY2) INTO v_result FROM TABLE WHERE USER_ID = v_user_id;
  RETURN v_result;
  END;
  </code></pre>
  
  <p>Now in my program in java Netbeans i need that result to use that inside my program.</p>
  
  <p>I have tried the following:</p>
  
  <pre><code>callStatement = con.prepareCall("SELECT GETTOTAL(1) FROM DUAL;");
  callStatement.execute();
  resultaat = callStatement.getDouble(1);
  callStatement.close();
  </code></pre>
  
  <p>I have also tried to use a CALL. But nothing seems to work.
  Also i've tried looking for the problem on the web, but it seems only procedures are explained and not functions... So i hope i can find an awnser here.</p>