Not sure if you're asking if you can actually change the database name or simply get a new connection to a named database.
If you just want to connect to a named database, then just do it when you create the connection via th DriverManager.
You may want to take a look at the vendor's
JDBC driver docs though as sometimes they add on little extra features that are not in the spec (or remove ones that are open to interpretation).
I seem to recall working with one awhile back that initially used the database name if it was passd in the URL when getting the Connection and then stopped using it even if it was included. They had the change documented though.
http://download.oracle.com/javase/6/docs/api/