You should be handling all exceptions when executing connection methods as a matter of course. Whether that is to log the exception message to a file or display a message to the user or both is your choice.
If you have the correct driver, specified the correct url and the database is running, the connection should be fine but you need to handle scenarios such as database server not running etc.