Package labsis.usuario.model

Examples of labsis.usuario.model.LogUsuario


    try {
      dl = new DaoLogUsuario();
      List<Object> list = dl.retrieve(pageNum, 15);
      Integer totalPages = (Integer) list.remove(list.size() - 1);
      for (Object o : list) {
        LogUsuario lu = (LogUsuario) o;
        l.add(lu);
      }
      l.add(new LogUsuario(totalPages, null, null, null));
    } catch (SQLException e) {
      e.printStackTrace();
    } catch (ClassNotFoundException e) {
      e.printStackTrace();
    } finally {
View Full Code Here


  private boolean addLog(String username, int operacaoid)
      throws SQLException, ClassNotFoundException {
    DaoLogUsuario dl = null;
    dl = new DaoLogUsuario();
    boolean b = dl.create(new LogUsuario(0, new Operacao(operacaoid, null,null),
        new Usuario(username, null, null, null), null));
    dl.close();
    return b;
  }
View Full Code Here

    conn = db.getConnection();
  }

  @Override
  public boolean create(Object o) throws SQLException {
    LogUsuario lu = (LogUsuario) o;
    PreparedStatement st = conn
        .prepareStatement("insert into logusuario(username, operacaoId) values(?,?)");
    st.setString(1, lu.getUsuario().getUsername());
    st.setInt(2, lu.getOperacao().getId());
    if (st.executeUpdate() > 0)
      return true;
    return false;
  }
View Full Code Here

    List<Object> l = new ArrayList<Object>();
    PreparedStatement st = conn
        .prepareStatement("select l.id, o.descricao, u.nome, l.data, o.comando from logusuario l join operacao o on l.operacaoId=o.id join usuario u on l.username = u.username");
    ResultSet r = st.executeQuery();
    while (r.next()) {
      l.add(new LogUsuario(r.getInt(1), new Operacao(0, r.getString(2),r.getString(5)),
          new Usuario("", "", r.getString(3), null), r.getTimestamp(4)));
    }
    return l;
  }
View Full Code Here

    st.setInt(2, rowsPerPage);
    st.setInt(3, pageNum);
    st.setInt(4, rowsPerPage);
    ResultSet r = st.executeQuery();
    while (r.next()) {
      l.add(new LogUsuario(r.getInt(2), new Operacao(0, r.getString(3),r.getString(6)),
          new Usuario("", "", r.getString(4), null), r.getTimestamp(5)));
    }
    st = conn.prepareStatement("select ((count(*) - 1) / ? ) + 1 from logusuario");
    st.setInt(1, rowsPerPage);
    ResultSet t = st.executeQuery();
View Full Code Here

TOP

Related Classes of labsis.usuario.model.LogUsuario

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.