There are some ways to improve performance of executing SQL Statements on a distant Database Server.
In case of SELECT queries it can be useful to analyze the queries and determine if all data which has been retrieved is really necessary. Size of the result can be drastically decreased, if you just retrieve specific fields instead of using SELECT * FROM xy WHERE ...
There is also the possiblity that you can put logic from application into a query, so only one query has to be sent to Database Server, instead of executing several queries and then process the result on Application Server.
In case of many similar INSERT or UPDATE statements several optimization processes can be done.
First of all it is useful to use PreparedStatements instead of normal statements as this takes load from Database Server as statements don't have to be generated new on every request.
In an second attempt it is useful to gather all statements into a Batch Job. And when you are finished with generating all statements you execute the Batch. So all data is sent together to the MySQL Database.
If you have several batches which have to be processed and should not return the result immediatly it is very useful to disable "AutoCommit". So you can execute all batches and commands and when you are finished sending all comands to server, you can execute COMMIT and everything is processed at once on database server. (Dont forget to enable "AutoCommit" afterwards again)
For my Internet Application these steps have increased the processing time of a large data update from about 3-4 Minutes down to 3 seconds.