public void writeToDatabase(String param){
		try {
			databaseCon dbCon = new databaseCon();
			Iterator iter = null;
			String procedure_id = "";
			String phenomenon_id = "";
			String offering_id = "";
			if(param == "CO"){
				iter = valuesCO.iterator();
				procedure_id = aqeSensors.getCoProcedure();
				phenomenon_id = aqeSensors.getCoPhenomenon();
				offering_id = aqeSensors.getCoOffering();
			}
		    else if (param == "humidity"){
		    	iter = valuesHumidity.iterator();
		    	procedure_id = aqeSensors.getHumidityProcedure();
				phenomenon_id = aqeSensors.getHumidityPhenomenon();
				offering_id = aqeSensors.getHumidityOffering();
		    }
		    else if (param == "NO2"){
		    	iter = valuesNO2.iterator();
		    	procedure_id = aqeSensors.getNo2Procedure();
				phenomenon_id = aqeSensors.getNo2Phenomenon();
				offering_id = aqeSensors.getNo2Offering();
		    }
		    else if (param == "temperature"){
		    	iter = valuesTemp.iterator();
		    	procedure_id = aqeSensors.getTemperatureProcedure();
				phenomenon_id = aqeSensors.getTemperaturePhenomenon();
				offering_id = aqeSensors.getTemperatureOffering();
		    }
		    else if (param == "O3"){
		    	iter = valuesO3.iterator();
		    	procedure_id = aqeSensors.getO3Procedure();
				phenomenon_id = aqeSensors.getO3Phenomenon();
				offering_id = aqeSensors.getO3Offering();
		    }
			//logger.info("write to database "+param);
			//iterate over datapoints collection
			//logger.info(iter.hasNext());
					while (iter.hasNext()){
						//logger.info("prepare query");
						JSONObject datapoint = (JSONObject) iter.next();
						String timestamp = datapoint.get("at").toString();
						Date date = utils.overlongTimestampToDate(timestamp);
						double value = Double.valueOf(datapoint.get("value").toString());
						dbCon.insertMeasurement(date, procedure_id, feedID, phenomenon_id, offering_id, value);
						//logger.info(timestamp+" "+value);
					}
			dbCon.disconnect();
			
		} catch (FileNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (java.text.ParseException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}