title: Replacing oracle's "OracleTypes.CURSOR" to an equivalent in mysql when using registerOutParameter function
body: <p>Dear stackoverflow community</p>
  
  <p>I am trying upgrade a system developed in JAVA from using oracle DB to mysql DB.</p>
  
  <p>I got to a point where to make use of a storaged procedure the java code makes use of a specific oracle structure - <code>OracleTypes.CURSOR</code>. Please see the code below.</p>
  
  <pre><code>private int getUserID(String username) {
      int UserID = -1;
      CallableStatement cs = null;
      ResultSet rs = null;
      try {
          con = this.getConnection();
          cs = con.prepareCall("{call getUserID(?,?)}");
          cs.setString(1, username);
          cs.registerOutParameter(2, OracleTypes.CURSOR);
          cs.execute();
          rs = (ResultSet) cs.getObject(2);
  
          if (rs.next()) {
              UserID = rs.getInt(1);
          }
      } catch (Exception e) {
          e.printStackTrace();
      } finally {
          try {
              cs.close();
              rs.close();
          } catch (SQLException ex) {
              Logger.getLogger(DBConnector.class.getName()).log(Level.SEVERE, null, ex);
          }
          closeConnection();
          return UserID;
      }
  }
  </code></pre>
  
  <p>What I am trying to do is to convert the use of <code>OracleTypes.CURSOR</code> to something mysql friendly.
  I did read that it would be posssible to do this in the newer version of mysql so I even tried replacing <code>OracleTypes.CURSOR</code> by <code>java.sql.Types.INTEGER</code> without any result.</p>
  
  <p>Can you help me?</p>
  
  <p>note: I have following previous information here on stack overflow and also other places like:
  <a href="http://bugs.mysql.com/bug.php?id=17898" rel="nofollow">http://bugs.mysql.com/bug.php?id=17898</a></p>