public Integer login(String uname, String pword) throws Throwable {
		md5 enc = new md5();
		SQLite_helper log = new SQLite_helper();
		ResultSet user = log.retrieve("users","username", uname);
		if(!user.next()) {
			enc.close();
			log.destruct();
			user.close();
			return 0;
		} else {
			String username = user.getString("username");
			if(username.compareTo(uname) == 0) {
				String pword_hash = enc.encrypt(pword);
				String password = user.getString("password");
				if(password.compareTo(pword_hash) == 0) {
					enc.close();
					if(user.getString("isAdmin").equals("true")) {
						enc.close();
						log.destruct();
						user.close();
						return 1;
					} else {
						enc.close();
						log.destruct();
						user.close();
						return 2;
					}
				} else {
					enc.close();
					log.destruct();
					return 0;
				}
			} else {
				enc.close();
				log.destruct();
				user.close();
				return 0;
			}
		}
	}