Advertisement
Guest User

Untitled

a guest
Jul 26th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. public void excluirAluno()
  2. {
  3. try {
  4. setId(Integer.parseInt(JOptionPane.showInputDialog("Digite o ID do aluno a ser excluido")));
  5. Connection conexao = DriverManager.getConnection("jdbc:mysql://localhost/bd_eclipse", "root", "etecjau" );
  6. PreparedStatement at = conexao.prepareStatement("DELETE FROM Aluno WHERE ID=?");
  7. at.setInt(1, getId());
  8. at.executeUpdate();
  9. conexao.close();
  10. }
  11. catch (Exception e)
  12. {
  13. JOptionPane.showMessageDialog(null, "Falha na exclusão");
  14. }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement