private void openDb() {

		GhidraFileChooser fileChooser = new GhidraFileChooser(this);
		fileChooser.setFileSelectionMode(GhidraFileChooserMode.FILES_ONLY);
		fileChooser.setFileFilter(new ExtensionFileFilter("gbf", "Ghidra Buffer File"));
		fileChooser.setCurrentDirectory(new File("C:\\"));

		fileChooser.setLastDirectoryPreference(LAST_BUFFER_FILE_DIRECTORY);

		File selectedFile = fileChooser.getSelectedFile(true);
		fileChooser.dispose();
		if (selectedFile == null) {
			return;
		}

		if (dbh != null) {
			closeDb();
		}
		Msg.debug(this, "Buffer file = " + selectedFile.getName());

		tables = new Table[0];
		try {
			dbFile = selectedFile;
			LocalBufferFile bf = new LocalBufferFile(selectedFile, true);
			dbh = new DBHandle(bf);
			tables = dbh.getTables();
			Arrays.sort(tables, new TableNameComparator());
		}
		catch (IOException e) {
			try {
				PackedDatabase pdb =
					PackedDatabase.getPackedDatabase(selectedFile, TaskMonitor.DUMMY);
				dbh = pdb.open(TaskMonitor.DUMMY);
				tables = dbh.getTables();
				Arrays.sort(tables, new TableNameComparator());
			}
			catch (Exception e1) {
				Msg.error(this, "Unexpected Exception: " + e1.getMessage(), e1);
				return;
			}

		}
		createMainPanel();
		closeItem.setEnabled(true);
	}
<code>DbViewer</code> is a diagnostic application for viewing a
Ghidra database.
Ghidra/Features/DebugUtils/src/main/java/db/DbViewer.java