public void updateCategory(int oldId, Category c) {
		Connection conn = null;
		Statement st = null;

		//Do nothing if category is not properly instantiated
		if(c == null || c.getIdNumber() == null)
			return;
		try {
			conn=DriverManager.getConnection("jdbc:mysql://localhost:3306/librarysystem?user=admin&password=123456");
			st=conn.createStatement();

			st.executeUpdate("UPDATE Category SET name = '" + c.getName() + "' WHERE idNumber = " + oldId);
			st.executeUpdate("UPDATE Category SET superCategoryId = " + c.getSuperCategoryId() + " WHERE idNumber = " + oldId);
			
			//Update idNumber last
			//Temporarily remove key constraint and update given category's id
			st.execute("SET foreign_key_checks = 0");
			st.executeUpdate("UPDATE Category SET idNumber = " + c.getIdNumber() + " WHERE idNumber = " + oldId);
			//Update all children
			st.executeUpdate("UPDATE Category SET superCategoryId = " + c.getIdNumber() + " WHERE superCategoryId = " + oldId);
			//Reinstate foreign key constraint
			st.execute("SET foreign_key_checks = 0");
			
		} catch (Exception e) {
			System.out.println(e.getMessage());
		}
		finally
		{
			try {
				if(conn != null)
					conn.close();
				if(st != null)
					st.close();
			} catch (Exception e) {	}
		}
	}