private void mongoCreator() throws UnknownHostException {
        DBHandler db = new DBHandler();
        MongoHandler dbmon = new MongoHandler();

        DB dbmongo = dbmon.connect();
        dbmongo.dropDatabase();
        
        db.openConnection();
        Statement st;
        String cadena[];
        String cadena2;

        try {
            st = db.getCon().createStatement();
               
            
            //Colección por marca de cámara
            ResultSet rs = st.executeQuery("SELECT CATEGORIES.VALUE_NAME AS CAMERA_BRAND, IMAGES.IMG_PATH, IMAGES.IMG_NAME , IMAGES.EXTENSION FROM ASOCIATED, IMAGES, CATEGORIES WHERE ASOCIATED.ID_IMG = IMAGES.ID_IMG AND ASOCIATED.VALUE_NAME = CATEGORIES.VALUE_NAME AND CATEGORIES.CAT_NAME like 'Exif IFD0' and CATEGORIES.TAG_NAME like 'Make'");
            JSONArray ja;
            ja = ResultSetConverter.convert(rs);

            DBObject dbObject;
            DBCollection collection = dbmongo.getCollection("CameraBrands");

            cadena2 = (ja.toString().substring(1, ja.toString().length() - 1));

            cadena2 = cadena2.replaceAll("},", "}<<->>");

            cadena = cadena2.split("<<->>");
            System.out.println(cadena2);

            for (String lenguaje : cadena) {
                dbObject = (DBObject) JSON.parse(lenguaje);
                collection.insert(dbObject);
            }
            st = db.getCon().createStatement();

            //Coleccion modelo de cámara
            rs = st.executeQuery("SELECT CATEGORIES.VALUE_NAME AS CAMERA_MODEL, IMAGES.IMG_PATH, IMAGES.IMG_NAME , IMAGES.EXTENSION FROM ASOCIATED, IMAGES, CATEGORIES WHERE ASOCIATED.ID_IMG = IMAGES.ID_IMG AND ASOCIATED.VALUE_NAME = CATEGORIES.VALUE_NAME AND CATEGORIES.CAT_NAME like 'Exif IFD0' and CATEGORIES.TAG_NAME like 'Model'");
            ja = ResultSetConverter.convert(rs);
            collection = dbmongo.getCollection("CameraModels");

            cadena2 = (ja.toString().substring(1, ja.toString().length() - 1));

            cadena2 = cadena2.replaceAll("},", "}<<->>");

            cadena = cadena2.split("<<->>");
            System.out.println(cadena2);

            for (String lenguaje : cadena) {
                dbObject = (DBObject) JSON.parse(lenguaje);
                collection.insert(dbObject);
            }

            //Coleccion por ISO
            rs = st.executeQuery("SELECT CATEGORIES.VALUE_NAME AS ISO_VALUE, IMAGES.IMG_PATH, IMAGES.IMG_NAME , IMAGES.EXTENSION FROM ASOCIATED, IMAGES, CATEGORIES WHERE ASOCIATED.ID_IMG = IMAGES.ID_IMG AND ASOCIATED.VALUE_NAME = CATEGORIES.VALUE_NAME AND CATEGORIES.CAT_NAME like 'Exif SubIFD' and CATEGORIES.TAG_NAME like 'ISO Speed Ratings'");
            ja = ResultSetConverter.convert(rs);
            collection = dbmongo.getCollection("SearchByISO");

            cadena2 = (ja.toString().substring(1, ja.toString().length() - 1));

            cadena2 = cadena2.replaceAll("},", "}<<->>");

            
             cadena2 = cadena2.replaceAll("(\"ISO_VALUE\"[:])(\")([0-9]+)(\")", "$1$3");
          
            
            cadena = cadena2.split("<<->>");
            System.out.println("DDD "+ cadena2);

            for (String lenguaje : cadena) {
                dbObject = (DBObject) JSON.parse(lenguaje);
                collection.insert(dbObject);
            }

            //Coleccion por Shutter Speed
            rs = st.executeQuery("SELECT CATEGORIES.VALUE_NAME AS SHUTTER_VALUE, IMAGES.IMG_PATH, IMAGES.IMG_NAME , IMAGES.EXTENSION FROM ASOCIATED, IMAGES, CATEGORIES WHERE ASOCIATED.ID_IMG = IMAGES.ID_IMG AND ASOCIATED.VALUE_NAME = CATEGORIES.VALUE_NAME AND CATEGORIES.CAT_NAME like 'Exif SubIFD' and CATEGORIES.TAG_NAME like 'Shutter Speed Value'");
            ja = ResultSetConverter.convert(rs);
            collection = dbmongo.getCollection("Shutter_Speed");

            cadena2 = (ja.toString().substring(1, ja.toString().length() - 1));

            cadena2 = cadena2.replaceAll("},", "}<<->>");

            cadena = cadena2.split("<<->>");
            System.out.println(cadena2);

            for (String lenguaje : cadena) {
                dbObject = (DBObject) JSON.parse(lenguaje);
                collection.insert(dbObject);
            }

            //Coleccion por distintas posibles Shutter Speed
            rs = st.executeQuery("SELECT DISTINCT CATEGORIES.VALUE_NAME AS SHUTTERSPEED FROM ASOCIATED, IMAGES, CATEGORIES WHERE ASOCIATED.ID_IMG = IMAGES.ID_IMG AND ASOCIATED.VALUE_NAME = CATEGORIES.VALUE_NAME AND CATEGORIES.CAT_NAME like 'Exif SubIFD' and CATEGORIES.TAG_NAME like 'Shutter Speed Value'");
            ja = ResultSetConverter.convert(rs);
            collection = dbmongo.getCollection("Possible_shutterSpeeds");

            cadena2 = (ja.toString().substring(1, ja.toString().length() - 1));

            cadena2 = cadena2.replaceAll("},", "}<<->>");

            cadena = cadena2.split("<<->>");
            System.out.println(cadena2);

            for (String lenguaje : cadena) {
                dbObject = (DBObject) JSON.parse(lenguaje);
                collection.insert(dbObject);
            }

            //Coleccion por Date created
            rs = st.executeQuery("SELECT CATEGORIES.VALUE_NAME AS DATE_VALUE, IMAGES.IMG_PATH, IMAGES.IMG_NAME , IMAGES.EXTENSION FROM ASOCIATED, IMAGES, CATEGORIES WHERE ASOCIATED.ID_IMG = IMAGES.ID_IMG AND ASOCIATED.VALUE_NAME = CATEGORIES.VALUE_NAME AND CATEGORIES.CAT_NAME like 'Exif SubIFD' and CATEGORIES.TAG_NAME like 'Date/Time Original'");
            ja = ResultSetConverter.convert(rs);
            collection = dbmongo.getCollection("Date_created");

            cadena2 = (ja.toString().substring(1, ja.toString().length() - 1));

            cadena2 = cadena2.replaceAll("},", "}<<->>");
            
            cadena2 = cadena2.replaceAll("(\"DATE_VALUE\"[:]\")([0-9]{4})[:]([0-9]{2})[:]([0-9]{2})([\\s][0-9]{2}[:][0-9]{2}[:][0-9]{2}\")", "$1$2-$3-$4\"");
            
            System.out.println("ddd" + cadena2);
            cadena = cadena2.split("<<->>");
            for (String lenguaje : cadena) {
                dbObject = (DBObject) JSON.parse(lenguaje);
                collection.insert(dbObject);
            }

            //Coleccion por GPS
            rs = st.executeQuery("SELECT CATEGORIES.VALUE_NAME AS GPS_VALUE, IMAGES.ID_IMG, IMAGES.IMG_PATH, IMAGES.IMG_NAME , IMAGES.EXTENSION FROM ASOCIATED, IMAGES, CATEGORIES WHERE ASOCIATED.ID_IMG = IMAGES.ID_IMG AND ASOCIATED.VALUE_NAME = CATEGORIES.VALUE_NAME AND CATEGORIES.CAT_NAME like 'GPS%' and (CATEGORIES.TAG_NAME like 'GPS Latitude' or CATEGORIES.TAG_NAME like 'GPS Longitude' or CATEGORIES.TAG_NAME like 'GPS Latitude Ref' or CATEGORIES.TAG_NAME like 'GPS Longitude Ref')order by IMAGES.ID_IMG, CATEGORIES.TAG_NAME");
            ja = ResultSetConverter.convert(rs);
            collection = dbmongo.getCollection("GPSFotos");

            cadena2 = (ja.toString().substring(1, ja.toString().length() - 1));

            cadena2 = cadena2.replaceAll("},", "}<<->>");

            cadena = cadena2.split("<<->>");
            System.out.println(cadena2);

            for (String lenguaje : cadena) {
                dbObject = (DBObject) JSON.parse(lenguaje);
                collection.insert(dbObject);
            }
            st.close();
            
            System.out.println("Mongo creada");

        } catch (SQLException ex) {
            System.err.println("SQL Error.\n" + ex);
        }

    }