コード例 #1
0
  public void insertAtividade(Atividade atividade) throws SQLException {
    sql =
        "INSERT INTO atividade (NOME, DESCRICAO, USER_MODIF, AUTOR, STATUS)" + "VALUES(?,?,?,?,?)";

    if (!FabricaConexoes.verificaConexao()) FabricaConexoes.getConexao();
    stm = FabricaConexoes.returnStatement(sql);
    stm.setString(1, atividade.getNome());
    stm.setString(2, atividade.getDescricao());

    stm.setInt(3, atividade.getUserModif());
    stm.setInt(4, atividade.getAutor());
    stm.setInt(5, atividade.getStatus());

    stm.execute();

    stm.close();
    FabricaConexoes.closeConnection();
  }