title: How to get output from stored procedure in JDBC
body: <p>I am trying to use JDBC and I've made a stored procedure. I want to call the stored procedure and then output the data output using the <code>System.out.println</code> in Java. How do I do that?  </p>
  
  <p>Below was my original stored procedure. I would like to get this to work but from reading I don't know if it is possible</p>
  
  <pre><code>DELIMITER $$
              CREATE
              PROCEDURE CountMembers()
              BEGIN
              SELECT COUNT(MEMBER_ID) FROM Members;
              END $$
      DELIMITER ;
  </code></pre>
  
  <p>Here is what I have changed it to because it seems to get the output this is what might have to be done.</p>
  
  <pre><code>DELIMITER $$
          CREATE
          PROCEDURE CountMembers(OUT m_count VARCHAR(30))
          BEGIN
          SELECT COUNT(MEMBER_ID) INTO m_count FROM Members;
          END $$
  DELIMITER ;
  </code></pre>
  
  <p>I know to run it I will have to make a callable Statement and then I've seen where <code>String userCount = callableStatement.getString(1);</code> can get the output. Basically I've read a lot of information, but I'm having a hard time putting it all together.</p>