@Override
	protected void dropDatabase() throws SQLException {

		if (getStatus() == Status.Busy || fileDs.getActiveConnections() != 0) {
			throw new SQLException("database in use");
		}

		close(); // close this instance

		if (!fileDs.exists()) {
			// ignore request and return
			return;
		}

		// Connect to database and examine schema
		HashSet<String> tableNames = new HashSet<>();
		try (Connection c = initConnection(); Statement st = c.createStatement()) {
			try (ResultSet rs = st.executeQuery(
				"SELECT table_name FROM information_schema.tables WHERE table_schema = 'public' ORDER BY table_name")) {
				while (rs.next()) {
					tableNames.add(rs.getString(1));
				}
			}
		}

		// Spot check for a few BSim table names that always exist
		if (!tableNames.contains("keyvaluetable") || !tableNames.contains("desctable") ||
			!tableNames.contains("weighttable")) {
			throw new SQLException("attempted to drop non-BSim database");
		}

		fileDs.dispose(); // disconnect before deleting database

		BSimServerInfo serverInfo = fileDs.getServerInfo();
		if (!fileDs.delete()) {
			throw new SQLException("failed to delete H2-file database: " + serverInfo);
		}

		Msg.info(this, "Deleted BSim H2-file database: " + serverInfo);

	}
Constructor used to connect to an existing H2 file database
@param ds local file H2 data source
Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/file/H2FileFunctionDatabase.java