Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void inserir(CampiBean campi) {
- String query = "INSERT INTO campi (nome, cod_admin) VALUES (?, ?)";
- PreparedStatement ps;
- try {
- ps = con.prepareStatement(query);
- ps.setString(1, campi.getNome());
- ps.setInt(2, campi.getCodAdmin());
- ps.execute();
- new Alert("Cadastro realizado com sucesso!", 2).iniciaJanela();
- } catch (SQLException ex) {
- new Alert("Erro: " + ex.getMessage(), 2).iniciaJanela();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement