private ArrayList<Image> getDataFromDataBaseOracle() throws SQLException{
        DbHandler db = new DbHandler();
        Statement st = db.connect();
        ArrayList<Image> files = null;

        ArrayList<Rute> rutes = db.getRutes(st);
        for (Rute r : rutes) {
            ArrayList<Image> images = db.getImages(st, r);
            for (Image i : images) {
               
                ArrayList<Value> values = db.getValues(st, i.getRute().getId(), i.getId());

                if ((values != null) && (!values.isEmpty())) {
                    ArrayList<Category> categories = new ArrayList<>();

                    for (Value v : values) {
                      
                        Itag tag = db.getTag(st, v.getIdTag(), v.getIdCategory());
                        tag.setValue(v.getValue());
                        Category category = db.getCategory(st, v.getIdCategory());

                        int c = 0;
                        while ((c < categories.size()) && (categories.get(c).getId() != category.getId())) {
                            c++;
                        }
                        if (c < categories.size()) {// Existe la categoria
                            categories.get(c).getTags().add(tag);

                        } else {// No existe la categoria
                            ArrayList<Itag> tags = new ArrayList<>();
                            tags.add(tag);
                            category.setTags(tags);
                            categories.add(category);
                        }
                    }
                    i.setCategories(categories);
                }
                if (files==null){
                    files = new ArrayList<Image>();
                }
                files.add(i);
            }
        }

        st.close();

        //MOSTRAMOS TODA LA INFORMACIÓN
        /*for (Image i : files) {
            System.out.println("******** FICHERO ********");
            System.out.println("Ruta: " + i.getRute().getName());
            System.out.println("Nombre: " + i.getName());
            System.out.println("Extensión: " + i.getExtension());
            System.out.println("Tamaño: " + i.getSize());

            //Mostramos las categorias y sus etiquetas
            if (i.getCategories() != null) {
                System.out.println("******** METADATOS ********");
                for (Category cat : i.getCategories()) {
                    System.out.println("");
                    System.out.println("CATEGORIA: " + cat.getName());
                    for (Itag t : cat.getTags()) {
                        System.out.println("--------------------------");
                        System.out.println("Etiqueta: " + t.getName());
                        System.out.println("Valor: " + t.getValue());
                    }
                }
            } else {
                System.out.println("NO TIENE CATEGORIAS");
            }

            System.out.println("");
            System.out.println("");
            System.out.println("");

        }*/
        return files;

    }