public static String getUserInfo(String username) throws SQLException {
		Statement statement = mysqlDB.createStatement();
		ResultSet result = statement
				.executeQuery("select * from v_user_info where Username = '"
						+ username + "'");
		String[] columns = new String[] { "Username", "Display", "Token",
				"Start", "End" };
		result.first();
		if (!(result.getDate("Start").before(new Date()) && result.getDate(
				"End").after(new Date()))) {
			// System.out.println("[INFO] User token expired generating new one");
			String token = new BigInteger(130, random).toString(32).substring(
					0, 15);
			// System.out.println("[INFO] New token: " + token);
			ResultSet res = statement
					.executeQuery("select max(t_id) as Max from t_token");
			res.first();
			int new_id = res.getInt("Max") + 1;
			GregorianCalendar cal = new GregorianCalendar();
			String start, end;
			start = cal.get(GregorianCalendar.YEAR)
					+ "-"
					+ String.format("%02d",
							cal.get(GregorianCalendar.MONTH) + 1) + "-01";
			end = cal.get(GregorianCalendar.YEAR)
					+ "-"
					+ String.format("%02d",
							cal.get(GregorianCalendar.MONTH) + 2) + "-02";
			statement.execute("insert into t_token set t_token = '" + token
					+ "', t_id = " + new_id + ", t_start = '" + start
					+ "', t_end = '" + end + "'");
			statement
					.execute("update u_user set u_t_token = "
							+ new_id
							+ " where u_id = (select l_u_user from l_login where l_uname = '"
							+ username + "')");
			result = statement
					.executeQuery("select * from v_user_info where Username = '"
							+ username + "'");
		}
		result.first();
		String ret = "{\"updates\":[{\"Id\":\"0\", \"Name\":\"User\", \"update\":[";
		for (int i = 0; i < columns.length; i++) {
			String json = "{\"Name\":\"" + columns[i] + "\", \"Value\":\""
					+ result.getString(columns[i]) + "\", \"Type\":\"STRING\"}";
			ret += json + (i == columns.length - 1 ? "" : ",");
		}
		ret += "]}]}}";
		statement.close();
		return ret;
	}