You need to check with the connection parameters (url, user name, password, dsn etc.,) you are passing.
Most of the times we get the exception when connection parameters are not correct.
Try to make a simple
jdbc connection from your
java class. If that works.. pass on the same parameters in server configuration.