If you need Mendix to talk to your external Oracle database, then take a look at the Database Connector module. We’ve used this to get Mendix to talk to a SQL Server successfully.
If you want to integrate Java code into Mendix, then you can put .jar files in your userlib directory, and create a Java Action to talk to them. Have a look at https://docs.mendix.com/howto/logic-business-rules/extending-your-application-with-custom-java for more details.
Good start will be the database connector form the mendix appstore i guess? See the documentation overthere.
You can get the data from other/legacy DBs into your mendix application using (Database Replication) module from the appstore.
While importing you can do any modifications you need on the data as well.
Thanks,
Sufian.