A few other hints. You can get the JDBC drivers here:
Connector/J 3.0. Make sure that you put the driver JAR file where your JDK/JVM can find them.
To connect, you'll do something like the following:
Of course you'll have to supply the ip-address of where the database is located (you can use "localhost" if it's on the same machine), the database instance (or it can be left off), the user and password (if required). After that it's just regular ol' JDBC stuff.