title: Java CallableStatement registerOutParameter, what does it do?
body: <p>I'm following a guide regarding callable statements.</p>
  
  <p>In this guide, it says that I need to register the out parameter with the follow statement:</p>
  
  <pre><code>callsts.registerOutParameter(2, java.sql.Types.VARCHAR);
  </code></pre>
  
  <p>QUESTION: Why do I need to do this/what does it do ?</p>
  
  <p>Complete Java code:</p>
  
  <pre><code>String getcall = "{call gettitle (?,?)}";
  CallableStatement callsts = connect.prepareCall(getcall);
  int nID = 15;
  callsts.setInt(1, nID);
  callsts.registerOutParameter(2, java.sql.Types.VARCHAR);
  callsts.execute();
  String calltitle = callsts.getString(2);
  System.out.println("Callable Stamement Title: "+calltitle);       
  </code></pre>
  
  <p>mySQL procedure:</p>
  
  <pre><code>DELIMITER $$ 
  DROP PROCEDURE IF EXISTS `nothingtowear`.`gettitle` $$
  CREATE PROCEDURE  `nothingtowear`.`gettitle` (
  IN nothingtowear_ID INT,
  OUT nothingtowear_TITLE VARCHAR( 255 )) 
  BEGIN 
  SELECT Title INTO nothingtowear_TITLE
  FROM articles
  WHERE ID = nothingtowear_ID;
  END $$
  DELIMITER;
  </code></pre>