Boa Tarde Pessoal!!
Gostaria de saber se o código a baixo esta correto, ele faz a exclusao dos dados da tabela, para isso acontecer a pessoa deve selecionar a linha e excluir… segue o código:
public boolean excluirDados()
{
ListSelectionModel rowSM = tabela.getSelectionModel();
if(rowSM.isSelectionEmpty())
{
JOptionPane.showMessageDialog(null, "Nenhum item selecionado!");
}
else
{
try
{
int selectedRow = rowSM.getMinSelectionIndex();
String iten = tabela.getValueAt(selectedRow, 0).toString();
stm = con.getStatement();
stm.executeUpdate("delete from funcionariosecs where NomeFuncionarioECS = "+iten);
}
catch(SQLException e)
{
e.printStackTrace();
return false;
}
}
return true;
}
Esta retornando o seguinte erro:
java.sql.SQLException: Unknown column 'Ana' in 'where clause'