Link two databases through the java application
Your solution is fine if you only have a couple of tables to copy.
If you have a whole database you could export the entire database to a SQL dump and them run that whole script in the new database manually.

If you need to do transformation to the data, then you can look into Oracle ETL tools.