MySql.
See comments, how to avoid 700 ms in process ?
Also the 300 ms should be like 1/2 or less of 300, testing with HeidiSQL
Connection is opened and does not influence a thing.
If you're asking how to improve JDBC driver methods, the short answer is you can't. You can try other drivers or databases, but likely this is a database specific issue.