Basically it's important to either re-use existing connections (e.g. create a connection once, store it in a variable and re-use that connection), or alternatively close the connection once it's no longer needed. Everytime "getSQLiteConnection()" is called, a new connection is created. Same about "getMySQLConnection()".
Only exception is the world database (this reuses the same connection automatically and doesn't need to be closed manually).
If you re-use a single connection, it's important to close statements and ResultSets. This is a typical pitfall. For example, when calling executeQuery() (which returns a ResultSet), make sure to close the ResultSet once you're done with the query (i.e. almost always a few lines after your query). The easiest and safest way to do that is to use a try-with-resources block (it closes the ResultSet automatically, even if an exception occurs), e.g. like this:
try (ResultSet result = db.executeQuery("SELECT * FROM `MyTable`")) {
It's not recommendable to do it this way, for example:
ResultSet result = db.executeQuery("SELECT * FROM `MyTable`");
The reason is that if an exception occurs between line 2 and 4, the result will never be closed (because an exception interrupts code execution, so line 5 will never be executed).
You can "fix" this by using a try-finally block, but it's ugly and more verbose than the try-with-resources block at the very top:
result = db.executeQuery("SELECT * FROM `MyTable`");
if (result != null) result.close();
You don't have to close ResultSets if you either close the connection, or alternatively use getConnection() and create statements manually (and close them accordingly - because closing the statement will automatically close related ResultSets). But even in these cases it's still better to just always use try-with-resources blocks when working with ResultSets