public static void showSearchResultsTable(ResultSet rs, String searchQuery,
			List<String> inputs) {
		int numCols;
		ResultSetMetaData rsmd;
		JTextArea tableTitle = null;
		JTable table = null;

		try {
			rsmd = rs.getMetaData();
			numCols = rsmd.getColumnCount() + 2;

			String columnNames[] = new String[numCols];
			for (int i = 0; i < numCols - 2; i++) {
				columnNames[i] = rsmd.getColumnName(i + 1);
			}
			columnNames[numCols - 2] = "IN";
			columnNames[numCols - 1] = "OUT";
			// For creating the size of the table
			PreparedStatement ps1 = Library.con.prepareStatement(searchQuery);
			for (int i = 0; i < inputs.size(); i++) {
				ps1.setString(i + 1, inputs.get(i));
			}

			ps1.executeQuery();
			ResultSet count = ps1.getResultSet();
			List<String> books = new ArrayList<String>();
			while (count.next()) {
				books.add(count.getString("callNumber"));
			}
			Object data[][] = new Object[books.size()][numCols];
			count.close();

			String callNumber;
			String isbn;
			String title;
			String mainAuthor;
			String publisher;
			int copiesAvailable = 0;
			int copiesOut = 0;
			int year;
			int j = 0;

			// Fill table
			while (rs.next()) {
				callNumber = rs.getString("callNumber");
				isbn = rs.getString("isbn");
				title = rs.getString("title");
				mainAuthor = rs.getString("mainAuthor");
				publisher = rs.getString("publisher");
				year = rs.getInt("year");

				// Check the number of available copies for a book
				PreparedStatement ps2 = Library.con
						.prepareStatement("SELECT count(*) from BookCopy WHERE callNumber = ? and status LIKE 'in'");
				ps2.setString(1, callNumber);
				ps2.executeQuery();
				ResultSet rs2 = ps2.getResultSet();
				if (rs2.next()) {
					copiesAvailable = rs2.getInt(1);
				}

				PreparedStatement ps3 = Library.con
						.prepareStatement("SELECT count(*) from BookCopy WHERE callNumber = ? and status LIKE 'out'");
				ps3.setString(1, callNumber);
				ps3.executeQuery();

				ResultSet rs3 = ps3.getResultSet();
				if (rs3.next()) {
					copiesOut = rs3.getInt(1);
				}

				Object tuple[] = { callNumber, title, mainAuthor, publisher,
						year, isbn, copiesAvailable, copiesOut };

				data[j] = tuple;
				j++;

			}

			rs.close();
			tableTitle = new JTextArea("Search Results");
			table = new JTable(data, columnNames);
			if (data.length == 0) {

				new ErrorMessage("No books found.");
			}
			table.setEnabled(false);
			JScrollPane scrollPane = new JScrollPane(table);
			table.setAutoCreateRowSorter(true);

			// Display table
			table.setFillsViewportHeight(false);
			tablePane.removeAll();
			tablePane.updateUI();
			tableTitle.setEditable(false);
			tablePane.add(tableTitle);
			tablePane.add(scrollPane);

		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

	}