public static void select(User currUser, Tables tables, Statement stmt,
			String query) {
		Iterator tableIter = tables.getIter();
		List<String> views = new LinkedList<String>();

		ResultSet rset;

		while (tableIter.hasNext()) {

			String table = (String) tableIter.next();

			if (query.toUpperCase().contains(table)) {

				try {
					rset = stmt.executeQuery("CREATE VIEW " + table
							+ currUser.userName + " as select * from " + table
							+ " where intLevel >= " + currUser.intLevel);

				} catch (Exception e) {
					e.printStackTrace();
				}

				query = query.replaceAll("(?i)" + table,
						table + currUser.userName).replace("\n", "");

				views.add(table);
			}
		}

		System.out.println(query + currUser.intLevel);
		System.out.flush();

		try {
			rset = stmt.executeQuery(query);
			ResultSetMetaData rsmd = rset.getMetaData();

			for (int i = 1; i <= rsmd.getColumnCount(); i++) {
				System.out.print(rsmd.getColumnName(i) + " ");
			}

			System.out.println();

			while (rset.next()) {
				for (int i = 1; i <= rsmd.getColumnCount(); i++) {
					System.out.print(rset.getString(i) + " ");
				}
				System.out.println();
			}
		} catch (Exception e) {
			e.printStackTrace();
		}

		for (String view : views) {
			try {
				rset = stmt.executeQuery("DROP VIEW " + view
						+ currUser.userName);
			} catch (SQLException e) {
				e.printStackTrace();
			}
		}
	}