title: Unknown sql queries
body: <p>I was trying to run this project i found on the internet but i get these errors in netbeans "com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: PROCEDURE contactos.sp_guardar does not exist" and they result from these two queries:</p>
  
  <p>update db</p>
  
  <p>String sql = "call sp_guardar(?,?,?,?,?)";</p>
  
  <p>search db</p>
  
  <p>String sql = "call buscar(?)";</p>
  
  <p>Would love to be assisted on this.Am using a mysql database connected though xammp</p>
  
  <p>The code for the project.</p>
  
  <pre><code>package contactosfx;
  
  import java.sql.CallableStatement;
  import java.sql.Connection;
  import java.sql.ResultSet;
  import java.sql.SQLException;
  import java.sql.Statement;
  import javafx.collections.FXCollections;
  import javafx.collections.ObservableList;
  
  public class AmigoDao implements AmigoInterface {
  
  
  public AmigoDao(){
  
  }
  
  @Override
  
  //UPDATE DB
  public void guardar(Amigo amigo) {
      Connection con = Conexion.conectar();
      CallableStatement cs = null;
      String sql = "call sp_guardar(?,?,?,?,?)";
  
  
      try {
          cs = con.prepareCall(sql);
          cs.setString(1, amigo.getFoto());
          cs.setString(2, amigo.getNombre());
          cs.setString(3, amigo.getCorreo());
          cs.setString(4, amigo.getTelf());
          cs.setInt(5, amigo.getEstado());
          cs.executeUpdate();
          cs.close();
          con.close();
  
      } catch (SQLException ex) {
          ex.printStackTrace();
      } finally {
          try {
              if (con != null) {
                  cs.close();
                  con.close();
              }
          } catch (SQLException ex) {
              ex.printStackTrace();
          }
      }
  }
  
  @Override
  public void actualizar(Amigo amigo, int id) {
      Connection con = Conexion.conectar();
      CallableStatement cs = null;
      //String sql = "call sp_actualizar(?,?,?,?,?,?)";
  
  
      try {
          cs = con.prepareCall(sql);
          cs.setString(1, amigo.getFoto());
          cs.setString(2, amigo.getNombre());
          cs.setString(3, amigo.getCorreo());
          cs.setString(4, amigo.getTelf());
          cs.setInt(5, amigo.getEstado());
          cs.setInt(6, id);
          cs.executeUpdate();
  
      } catch (SQLException ex) {
          ex.printStackTrace();
      } finally {
          try {
              if (!con.isClosed()) {
                  cs.close();
                  con.close();
              }
          } catch (SQLException ex) {
              ex.printStackTrace();
          }
      }
  
  }
  
  @Override
  public ObservableList&lt;Amigo&gt; buscar(String nombres) {
      Connection con = Conexion.conectar();
      CallableStatement cs = null;
      ResultSet rs = null;
      ObservableList&lt;Amigo&gt; lista = FXCollections.observableArrayList();
      String sql = "call buscar(?)";
      //String sql = "call search(?)";
  
      try {
          cs = con.prepareCall(sql);
          cs.setString(1, nombres);
          rs = cs.executeQuery();
          while(rs.next()){
              lista.add(new Amigo(rs.getInt(1),rs.getString(2),rs.getString(3),rs.getString(4),rs.getString(5),rs.getInt(6)));
          }
  
      } catch (SQLException ex) {
          ex.printStackTrace();
      }
      return lista;
  }
  
  @Override
  public ObservableList&lt;Amigo&gt; buscarHabilitados() {
      Connection con = Conexion.conectar();
      Statement st = null;
      ResultSet rs = null;
      String sql = "select*from habilitados";
      ObservableList&lt;Amigo&gt; lista = FXCollections.observableArrayList();
      try {
          st = con.createStatement();
          rs = st.executeQuery(sql);
  
          while (rs.next()) {
              lista.add(new Amigo(rs.getInt(1), rs.getString(2), rs.getString(3), rs.getString(4), rs.getString(5), rs.getInt(6)));
          }
      } catch (SQLException e) {
          e.printStackTrace();
      }
      return lista;
  }
  
  @Override
  public ObservableList&lt;Amigo&gt; buscarDeshabilitados() {
      Connection con = Conexion.conectar();
      Statement st = null;
      ResultSet rs = null;
      String sql = "select*from deshabilitados";
      ObservableList&lt;Amigo&gt; lista = FXCollections.observableArrayList();
      try {
          st = con.createStatement();
          rs = st.executeQuery(sql);
  
          while (rs.next()) {
              lista.add(new Amigo(rs.getInt(1), rs.getString(2), rs.getString(3), rs.getString(4), rs.getString(5), rs.getInt(6)));
          }
      } catch (SQLException e) {
          e.printStackTrace();
      }
      return lista;
  
  }
  </code></pre>
  
  <p>}</p>
  
  <p><a href="http://i.stack.imgur.com/TAzGP.png" rel="nofollow">the database table screenshot</a></p>