public void writeMisc() {		
		Debug.print("Write misc called");
		try {
			PreparedStatement pStatement = conn.prepareStatement("SELECT COUNT(*) FROM misc WHERE name = ?;");
			
			String sql = "insert into misc (Name,Descr,Stock,Units,Cost,Stage) " +
					"values(?, ?,  ?,  ? ,  ?,?  )";
			
			PreparedStatement insertMisc = conn.prepareStatement(sql);
			
			ResultSet res = null;
		
		
			int i = 0;
			
			while (i < miscDB.size()) {
				Misc m = miscDB.get(i);
				pStatement.setString(1, m.getName());
				res = pStatement.executeQuery();
				
				res.next();
				if(res.getInt(1) == 0) {
					//Name,Descr,Stock,Units,Cost,Stage
				
					insertMisc.setString(1, m.getName());
					insertMisc.setString(3, Double.toString(m.getCostPerU()));
					
					insertMisc.setString(2, m.getDescription());
					insertMisc.setString(4, m.getUnitsAbrv());
					insertMisc.setString(6, m.getStage());
					insertMisc.setString(5, Double.toString(m.getCostPerU()));
					
					pStatement.execute();
				
				}
				
				i++;
			}



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