Try to specify the port in
conn = DriverManager.getConnection("jdbc:mysql://localhost/mysql?"
+ "user=root&password=onelife");
I think you should have something like this:
conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/mysql?"
+ "user=root&password=onelife");
Also, the port number in my example (3306) is the default port, but you may change it while installing MySQL.
I think that a better way to specify password and user is to separate them from the URL like this:
connection = DriverManager.getConnection(url, login, password);