title: How to call PLSQL function from java
body: <p>I have a PLSQL FUNCTION. PKG_GAS_KT.GET_DEPTINFO('{UserID}') This function returns the name of the Department the user is in.</p>
  
  <p>Now, I've a list of UserID in java. How can I pass all the UserId's and get the department of the respective user.
  <strong>Is there any way to do it without putting it inside a for loop and making unwanted calls to the database. Also:</strong></p>
  
  <pre><code>    CallableStatement  callSt = con.prepareCall("{?= call PKG_GAS_KT.GET_DEPTINFO(?)}");`// Is this correct way to call my PLSQL function?
      callSt.setInt(1,101);
      callSt.registerOutParameter(2, Types.STRING);
      callSt.execute();
      Double output = callSt.getString(2);
  </code></pre>
  
  <p>Any guidance is appreciated. <strong>I cannot change anything in PLSQL function.</strong></p>