title: Handle stored procedure in mysql
body: <p>I have a button in gwt and on each click i want that value should increase in the database. How should i do using stored procedure. Its like hitting like button and increasing the counter on the particular post. new for all this want help.</p>
  
  <pre><code>    public String fun()
      {
             Connection con=null;
  
             CallableStatement pt=null;
  
           try
           {
  
                 Class.forName("com.mysql.jdbc.Driver");
                 con=DriverManager.getConnection("jdbc:mysql://localhost:3306/check", "root", "root");                
  
  
                  pt=(CallableStatement)con.prepareCall("{call ask (1)}");
  
                  pt.executeUpdate();
  
                  System.out.println("2");
                           }
                  con.close();
                  pt.close();
  
          }
  
          catch(Exception e)
          {
              e.printStackTrace();
          }
       return""; 
  }
  }
  </code></pre>
  
  <p>STORED PROCEDURE:</p>
  
  <p>DELIMITER $$</p>
  
  <p>CREATE DEFINER=<code>root</code>@<code>localhost</code> PROCEDURE <code>ask</code>(IN good int)
  BEGIN
  update likepost set hitlike=hitlike+1 where idlikepost=1 ;
  END</p>
  
  <p>TASK COMPLETED YIPEE!!!!</p>