Hi Tobias,
One way which I can think of is making http calls to MII using Illuminator service.
Using this service you can make calls for query templates and also to data servers.
Refer the links for the URL of the Illuminator Service
URL Format for Queries - Content Development - SAP Library
Refer the link to see how to make http calls from java code:
How to send HTTP request GET/POST in Java
Regards,
Rohit Negi.