So normally, you would use this:
Connection conn = DriverManager.getConnection("jdbc:mysql://[ip:mysqlport]/[databasename]?user=[user]&password=[password]");
However, I need to connect to an IP using a specific port in addition to specifying the MySQL port as well. I tried ip:serverport:mysqlport, but it didn't work.
Edit: Nevermind, I was misunderstanding something.