public void writeHops() {		
			// Name,Alpha,Cost,Stock,Units,Descr,Storage,Date,Modified
		Debug.print("Write Hops to DB");
		try {
			PreparedStatement pStatement = conn.prepareStatement("SELECT COUNT(*) FROM hops WHERE name = ?;");
			PreparedStatement rStatement = conn.prepareStatement("SELECT COUNT(*) FROM hops WHERE name = ?" +
					" AND Alpha=? AND Cost=? AND Stock=? AND " +
					"Units=? AND Descr=? AND Storage=? AND Type = ?;");
			
			String sql = "insert into hops (Name,Alpha,Cost,Stock,Units,Descr,Storage,Date, Type) " +
					"values(?, ?,  ? , ?, ?, ?, ?, ?, ? )";
			
			PreparedStatement insertMisc = conn.prepareStatement(sql);
			
			sql = "UPDATE hops SET Alpha=?,Cost=?,Stock=?," +
					"Units=?,Descr=?,Storage=?,Date=?,Type=? " +
					"WHERE name = ?";
			
			PreparedStatement updateMisc = conn.prepareStatement(sql);
			
			ResultSet res = null;
		
			int i = 0;
			
			//Sort the list
			Collections.sort(hopsDB);
			
			while (i < hopsDB.size()) {
				Hop h = hopsDB.get(i);
				i++;
				pStatement.setString(1, h.getName());
				res = pStatement.executeQuery();
				res.next();
				// Does this hop exist?
				if(res.getInt(1) == 0){
					insertMisc.setString(1, h.getName());
					insertMisc.setString(2, Double.toString(h.getAlpha()));
					insertMisc.setString(3, Double.toString(h.getCostPerU()));
					insertMisc.setString(4, Double.toString(h.getStock()));
					insertMisc.setString(5, h.getUnitsAbrv());
					insertMisc.setString(6, h.getDescription());
					insertMisc.setString(7, Double.toString(h.getStorage()));
					insertMisc.setString(8, h.getDate().toString());
					insertMisc.setString(9, h.getType());
			
					insertMisc.executeUpdate();
				} else { // check to see if we need to update this hop
					
					rStatement.setString(1, h.getName());
					rStatement.setString(2, Double.toString(h.getAlpha()));
					rStatement.setString(3, Double.toString(h.getCostPerU()));
					rStatement.setString(4, Double.toString(h.getStock()));
					rStatement.setString(5, h.getUnitsAbrv());
					rStatement.setString(6, h.getDescription());
					rStatement.setString(7, Double.toString(h.getStorage()));
					rStatement.setString(8, h.getType());
					
					System.out.println(h.getName() + " - " + h.getType());
					res = rStatement.executeQuery();
					
					res.next();
				
					if(res.getInt(1) == 0) {
						// update required
						updateMisc.setString(1, Double.toString(h.getAlpha()));
						updateMisc.setString(2, Double.toString(h.getCostPerU()));
						updateMisc.setString(3, Double.toString(h.getStock()));
						updateMisc.setString(4, h.getUnitsAbrv());
						updateMisc.setString(5, h.getDescription());
						updateMisc.setString(6, Double.toString(h.getStorage()));
						updateMisc.setString(7, h.getDate().toString());
						updateMisc.setString(8, h.getType());
						// where
						updateMisc.setString(9, h.getName());
						System.out.println(updateMisc.toString());
						updateMisc.executeUpdate();
					}
					
				}
			}

			//clear the list
			hopsDB = new ArrayList<Hop>();
			stockHopsDB = new ArrayList<Hop>();
			
			readHops(dbPath);

		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
	}