public class AlunoDao {
public void create (Aluno a){
Connection con = ConnectionFactory.getConnection();
PreparedStatement stmt = null;
try {
stmt= con.prepareStatement("INSERT INTO aluno(Nome, CPF, Email, Endereco, uf, telefone)VALUES (?, ?, ?, ?, ?, ?)");
stmt.setString(1, a.getNomePessoa());
stmt.setString(2, a.getCpf());
stmt.setString(3, a.getEmail());
stmt.setString(4, a.getEndereco());
stmt.setString(5, a.getUf());
stmt.setString(6, a.getTelefone());
stmt.executeUpdate();
JOptionPane.showMessageDialog(null, "Salvo com Sucesso");
}catch (HeadlessException | SQLException e) {
JOptionPane.showMessageDialog(null, "Erro ao Salvar");
} finally{
ConnectionFactory.closeConection(con, stmt);
}