public void setQuery(String q)
	{
		tmp = new Vector<String[]>();
		try
		{
			ResultSet rs = statement.executeQuery(q);
			ResultSetMetaData meta = rs.getMetaData();
			columns = meta.getColumnCount();

			headers = new String[columns];
			for (int i = 1; i <= columns; i++)
				headers[i - 1] = meta.getColumnName(i);

			while (rs.next())
			{
				String[] record = new String[columns];
				for (int i = 0; i < columns; i++)
					record[i] = rs.getString(i + 1);

				tmp.addElement(record);
			}
			fireTableChanged(null);
		}
		catch (Exception e)
		{
			tmp = new Vector<String[]>();
			logField.setText(logField.getText()
					+ "\nError! time: " + System.currentTimeMillis() + ",\n"
					+ e.getMessage());
		}
	}