Examples of Ingrediente


Examples of Inventario.almacen.Ingrediente

    }

    private int obtenerIDDeUsuario(String usuario) {
        conectarABaseDeDatos();
        int id = -1;
        Ingrediente i = null;
        try {
            consulta = conexion.createStatement();
            resultados = consulta.executeQuery("SELECT id FROM usuario WHERE nombre = '" + usuario + "'");
            resultados.next();
            id = resultados.getInt("id");
View Full Code Here

Examples of Inventario.almacen.Ingrediente

            if (numFils != 0) {
                ingredientesFelices = new Vector<Ingrediente>();
                resultados.beforeFirst();//mover antes de empezar
                while (resultados.next()) {
                    idIngrediente_enesimo = resultados.getInt(1);
                    Ingrediente ingrediente = obtenerIngredientePorID(idIngrediente_enesimo);
                    ingredientesFelices.add(ingrediente);
                }
            }
        } catch (SQLException ex) {
            Logger.getLogger(ServicioDeAccesoABaseDeDatos.class.getName()).log(Level.SEVERE, null, ex);
View Full Code Here

Examples of Inventario.almacen.Ingrediente

        return ingredientesFelices;
    }

    private Ingrediente obtenerIngredientePorID(int idIngrediente) {
        conectarABaseDeDatos();
        Ingrediente i = null;
        try {
            consulta = conexion.createStatement();
            resultados = consulta.executeQuery("SELECT * FROM ingrediente WHERE id = '" + idIngrediente + "'");
            resultados.next();
            String nombre = resultados.getString("nombre");
            Date caducidad = new Date(resultados.getString("caducidad"));
            int vecesUsable = resultados.getInt("veces_usable");
            String descripcion = resultados.getString("descripcion");
            i = new Ingrediente();
            i.setNombre(nombre);
            i.setFechaDeCaducidad(caducidad);
            i.setVecesQueSePuedeUsar(vecesUsable);
            i.setDescripcion(descripcion);
        } catch (SQLException ex) {
            Logger.getLogger(ServicioDeAccesoABaseDeDatos.class.getName()).log(Level.SEVERE, null, ex);
        } finally {

        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.