The only problem, as per me, seems to be that your PC is not able to locate Mysql.
So, while doing connectivity means JDBC, you need to specify the IP of the computer where your mysql is located.
If that's fine, then there is problem in configuration and settings that you need to do in windows, like setting up System DSN and username and password of mysql at that particular PC.
These are the general mistakes.
If still there's any problem, better post your code.