Пример #1
0
 public void incluir(AlunoDO aluno, Transacao tr) throws Exception {
   Connection con = tr.obterConexao();
   String sql =
       "insert into aluno (id, nusp, email, nome, sobrenome, link_lattes, instituicao, codigo_hist) values (?, ?, ?, ?, ?, ?, ?, ?)";
   PreparedStatement ps = con.prepareStatement(sql);
   ps.setInt(1, aluno.getId());
   ps.setString(2, aluno.getNusp());
   ps.setString(3, aluno.getEmail());
   ps.setString(4, aluno.getNome());
   ps.setString(5, aluno.getSobrenome());
   ps.setString(6, aluno.getLattes());
   ps.setString(7, aluno.getInstituicao());
   ps.setString(8, aluno.getHist());
   int result = ps.executeUpdate();
 }
Пример #2
0
 public void atualizar(AlunoDO aluno, Transacao tr) throws Exception {
   Connection con = tr.obterConexao();
   String sql =
       "update aluno set nusp=?, email=?, nome=?, sobrenome=?, link_lattes=?, instituicao=?, codigo_CV=?, codigo_hist=? where id=?";
   PreparedStatement ps = con.prepareStatement(sql);
   ps.setString(1, aluno.getNusp());
   ps.setString(2, aluno.getEmail());
   ps.setString(3, aluno.getNome());
   ps.setString(4, aluno.getSobrenome());
   ps.setString(5, aluno.getLattes());
   ps.setString(6, aluno.getInstituicao());
   ps.setString(7, aluno.getCv());
   ps.setString(8, aluno.getHist());
   ps.setInt(9, aluno.getId());
   int result = ps.executeUpdate();
 } // atualizar