static SymbolDatabaseAdapter getAdapter(DBHandle dbHandle, OpenMode openMode,
			AddressMap addrMap, TaskMonitor monitor)
			throws VersionException, CancelledException, IOException {

		if (openMode == OpenMode.CREATE) {
			return new SymbolDatabaseAdapterV4(dbHandle, addrMap, true);
		}

		try {
			SymbolDatabaseAdapter adapter = new SymbolDatabaseAdapterV4(dbHandle, addrMap, false);
			return adapter;
		}
		catch (VersionException e) {
			if (!e.isUpgradable() || openMode == OpenMode.UPDATE) {
				throw e;
			}
			SymbolDatabaseAdapter adapter = findReadOnlyAdapter(dbHandle, addrMap);
			if (openMode == OpenMode.UPGRADE) {
				adapter = upgrade(dbHandle, addrMap, adapter, monitor);
			}
			else if (adapter instanceof SymbolDatabaseAdapterV0) {
				// Upgrade required - read-only use not supported
				throw e;
			}
			return adapter;
		}
	}
Gets a new SymbolDatabaseAdapter
@param dbHandle the database handle
@param openMode the open mode
@param addrMap the address map
@param monitor the progress monitor
@return a new SymbolDatabaseAdapter
@throws VersionException if the database table does not match the adapter
@throws CancelledException if the user cancels an upgrade
@throws IOException if a database io error occurs
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/symbol/SymbolDatabaseAdapter.java