Skip to content

Commit

Permalink
Merge pull request #216 from gustavohenriquefs/Fix/InserirGrupoEventos
Browse files Browse the repository at this point in the history
definindo id ao final de insert
  • Loading branch information
robsonad07 authored Dec 6, 2023
2 parents ec0d3c9 + e40fc20 commit 23ace33
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,12 @@ INSERT INTO grupo_eventos(
preparedStatement.setDate(11, grupoEventos.getDataInicial());
preparedStatement.setDate(12, grupoEventos.getDataFinal());

preparedStatement.execute();
preparedStatement.executeUpdate();
ResultSet rs = preparedStatement.getGeneratedKeys();
if (rs.next()) {
grupoEventos.setIdGrupoEventos(rs.getInt("id_grupo_eventos"));
}

return true;
} catch (Exception exception) {
String nomeGrupoEventosCausa = "";
Expand Down

0 comments on commit 23ace33

Please sign in to comment.