Package br.edu.puc.campinas.si.pw.pucstore.persistence

Examples of br.edu.puc.campinas.si.pw.pucstore.persistence.DB


    }   

  }
 
  public List<Venda> obterPorCliente(int id) throws Exception {
    DB db = DBFactory.getInstancia();
   
    String sql = "select cod_venda, cod_usuario from venda where cod_usuario = {cod_usuario} ";
   
    sql = sql.replace("{cod_usuario}", String.valueOf(id));
   
    List<Venda> vendas = new ArrayList<Venda>();
   
    ResultSet rs = db.execConsulta(sql);
   
    while(rs.next()) {   
      vendas.add(popularEntidade(rs));
    }
   
View Full Code Here


  }
 
  public int gerarCodigoVenda() throws Exception {
   
    DB db = DBFactory.getInstancia();
   
    String sql = "select ifnull(max(cod_venda), 0)+1 cod_futura_venda from venda ";
   
    ResultSet rs = db.execConsulta(sql);
   
    rs.next();
   
    return rs.getInt("cod_futura_venda");   
View Full Code Here

TOP

Related Classes of br.edu.puc.campinas.si.pw.pucstore.persistence.DB

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.