Olá pessoal, já fiz o inserir e o atualizar porém não estou conseguindo fazer o DELETE podem me ajudar segue o código abaixo e a mensagem de erro. Telvez o erro esteja na sintaxe que estou utilizando do mysql.
[CÓDIGO]
package br.com.people.dao;
import br.com.people.tabela.Pessoa;
import java.util.List;
/*
Throws envia a mensagem de erro para o metodo da pilha anterior que o chamou.
*/
public interface PessoaDAO {
public void insert (Pessoa p) throws Exception;
public void delete (Long idpessoa) throws Exception;
public List findAll() throws Exception;
public void update(Pessoa p) throws Exception;
}
[/CÓDIGO]
[CÓDIGO COM ERRO]
package br.com.people.main;
import java.sql.Connection;
import java.util.Calendar;
import br.com.people.connection.factory.ConnectionFactory;
import br.com.people.dao.PessoaDAO;
import br.com.people.dao.impl.PessoaDAOImpl;
import br.com.people.tabela.Pessoa;
public class MainDelete {
public static void main(String[] args) {
try {
//Abrir a Conexao
Connection conn = ConnectionFactory.getConnection();
PessoaDAO daoPessoa = new PessoaDAOImpl(conn);
daoPessoa.delete (new Long(1));
System.out.println("Apagado com Sucesso!!!.");
//Sempre Fechar a Conexão.
conn.close();
} catch (Exception e) {
System.out.println("Erro ao excluir :"+ e.getMessage());
e.printStackTrace();
}
}
}
[/CÓDIGO]
MENSAGEM DE ERRO: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘pessoa=1’ at line 1
