public static Vector<String[]> getQueryData(String tableName,
			Vector<String> headers) {
		Vector<String[]> rowsData = new Vector<String[]>();
		try {
			statement = (PreparedStatement) connection
					.prepareStatement("SELECT * FROM " + tableName);
			rs = statement.executeQuery();
			ResultSetMetaData meta = rs.getMetaData();
			int numOfCols = meta.getColumnCount();

			// rebuild the headers array with the new column names
			headers.clear();
			for (int h = 1; h <= numOfCols; h++) {
				headers.add(meta.getColumnName(h));
			}

			while (rs.next()) {
				String[] record = new String[numOfCols];
				for (int i = 0; i < numOfCols; i++) {
					record[i] = rs.getString(i + 1);
				}
				rowsData.addElement(record);
			}
		} catch (SQLException e) {
			while (e != null) {
				e.printStackTrace();
				e = e.getNextException();
			}
		}
		return rowsData;
	}