public Table(String name) throws Exception{
		
		this.name = name;
		
		File table = new File("Databases/" + name + ".xml");
		if(!table.exists())
			throw new Exception("The table " + name + " doesn't exist.");
		
		SAXBuilder builder = new SAXBuilder();
	 
		try {
	 
			Document document = (Document) builder.build(table);
			Element rootNode = document.getRootElement();
			this.nextIndex = Integer.parseInt(rootNode.getAttributeValue("nextIndex"));
			List<Element> columns = rootNode.getChildren("columns").get(0).getChildren("column");
			
			this.columns = new HashMap<String,Column>();
			for(Element column : columns){
				Column col = new Column(column.getAttributeValue("name"), Column.Type.fromString(column.getAttributeValue("type")));
				if(column.getAttribute("index") != null){
					col.setIndex(true);
					this.indexColumn = col.getName();
				}
				this.columns.put(col.getName(), col);
			}
	 
		} catch (IOException io) {
			System.out.println(io.getMessage());
		} catch (JDOMException jdomex) {
			System.out.println(jdomex.getMessage());
		}
		
	}