public Settings getSettings(int rId)
	{
		Settings result = null;
		String strStatement = "SELECT r.rThreshold, sl.slSearchSentenceLength, sl.slSearchJumpLength, sl.slSearchNumLinks, sl.slCompareSentenceLength, sl.slCompareJumpLength, r.rCheckWWW, r.rCheckIDs, se.seName, se.seURL , se.seURLSearchArg, se.seURLAuthArg, se.seURLArgs FROM report AS r LEFT JOIN settinglevel AS sl ON r.slID = sl.slID LEFT JOIN searchengine AS se ON r.seID = se.seID WHERE r.rID = " + rId;
		ResultSet rstResultSet = null;
		try
		{
			rstResultSet = startQuery(strStatement);
			if (rstResultSet.next())
			{
				result = new Settings();
				String input = rstResultSet.getString("r.rCheckIDs");
				ArrayList<Integer> localFiles = new ArrayList<Integer>();
				if (input.length() > 0)
				{
					SerializedPhpParser serializedPhpParser = new SerializedPhpParser(input);
					LinkedHashMap<Integer, String> fileHashMap = (LinkedHashMap<Integer, String>) serializedPhpParser.parse();
					StringBuilder sb = new StringBuilder();

					if (!fileHashMap.isEmpty())
					{
						for (Integer key : fileHashMap.keySet())
						{
							if (fileHashMap.get(key).length() == 0)
							{
								_logger.fatal("There is an Error for " + key);
							}
							else
							{
								if (sb.length() != 0)
								{
									sb.append(",");
								}
								sb.append(fileHashMap.get(key));
							}
						}

						String statementFile = "SELECT dID from document as d WHERE fID IN (" + sb.toString() + ")";
						ResultSet rstResultSetFile = startQuery(statementFile);
						while (rstResultSetFile.next())
						{
							localFiles.add(rstResultSetFile.getInt("d.dID"));
						}
					}
				}
				result.putSettings(rstResultSet.getInt("r.rThreshold"), rstResultSet.getInt("sl.slSearchSentenceLength"), rstResultSet.getInt("sl.slSearchJumpLength"), rstResultSet.getInt("sl.slCompareSentenceLength"), rstResultSet.getInt("sl.slCompareJumpLength"), rstResultSet.getBoolean("r.rCheckWWW"), localFiles, rstResultSet.getString("se.seURL"), rstResultSet.getString("se.seURLSearchArg"), rstResultSet.getString("se.seURLAuthArg"), rstResultSet.getString("se.seUrlArgs"), rstResultSet.getInt("sl.slSearchNumLinks"));
			}
		}
		catch (SQLException e)
		{
			_logger.fatal(e.getMessage(), e);
			e.printStackTrace();
		}
		catch (Exception e)
		{
			_logger.fatal(e.getMessage(), e);
			e.printStackTrace();
		}
		finally
		{
			disconnect();
		}

		return result;
	}