I would like to know if you can play Minecraft Java Edition on the iPad? You could connect a mouse via bluetooth and buy a keyboard to go with it. So would it be theoretically possible?
No, you can't. You have iOS on the iPad. Therefore, you can only download or buy those designed for iOS and Android. In this case the Bedrock edition.
For the Java edition you need Windows, Linux or Mac.
Yes, you have to jailbreak it for this. You also need Filza from Cydia. Jailbreaking can damage the device. This video shows the installation process of the "PojavLauncher" (Minecraft Java for iOS)