public boolean addTag(String name, String appId, String userId)
	{		

		//Tag validation and parameters checking
		if(!validateTag(name))
			return false;
		if(appId == null || appId.equals(""))
			return false;
		if(userId == null || userId.equals(""))
			return false;
		
		try 
		{
			
			String query = 	"SELECT ID FROM TagNode WHERE NAME='" + name + 
							"' AND APPLICATION_ID='" + appId +"' AND UID='" + userId + "'";

			//drozas&alfredo: If it has already been stored, return false
			String[][] res = pm.executeQuery(query, false);
			
			if(res.length>0) 
			{
				return false;
			}
			
			query = "INSERT INTO TagNode (NAME,APPLICATION_ID,UID) VALUES " +
					"('" + name  + "' , '" + appId + "', '" + userId +"')";
			
			pm.executeQuery(query, true);
						
			
		}catch (PersistencyException e)
		{
			System.out.println( "It was not possible to add the tag " + name +  " for the application " + appId + 
								" by the user " + userId +  " in the database");

			return false;
		}
		
		return true;
	}