It looks confusing because there is a separation between the driver and connection when first connecting to a database. This ends up being very useful in the long run since it helps write code which is independent of the database, but that doesn't help the initial confusion.
To connect to a database (in general) you need these things:
1) The fully qualified class name of the Driver class
2) The Database URL - more in a minute
3) The DB username and password.
(see
http://dev.mysql.com/doc/refman/5.0/en/connector-j-reference-configuration-properties.html) For MySQL the driver class should usually be "com.mysql.jdbc.Driver", but sometimes you'll still see "org.gjt.mm.mysql.Driver"
The username and password you set up yourself.
The MySQL database URL is in the form
jdbc:mysql://[host:port],[host:port].../[database][?propertyName1][=propertyValue1][&propertyName2][=propertyValue2]...
On localhost, on the default port for a database called 'myDatabase' this gives the DB URL:
jdbc:mysql://localhost/myDatabase
although I tend to include the port even if it is standard, as I have sometimes had issues:
jdbc:mysql://localhost:3306/myDatabase
Now to get a connection you do this:
Class.forName(driver_name);
Connection conn = DriverManager.getConnection(DB_URL, username, password);
I haven't put the specific strings into the last part, as it is exactly the same for every DB once you have parts 1, 2 and 3.
I mentioned a separation above, and this is where the DB URL ends up telling the DriverManager which Driver to use to get a Connection. If you go straight to the specific Driver then your code becomes coupled to a Database. If you keep them as Strings - and use the correct values - then they find each other and you can easily move the Strings to a Properties file and suddenly you can change to almost any DB. I theory, anyway.
Dave