Again it gives the following error. java.lang.ClassNotFoundException: com.mysql.jdbc.Driver is there any necessaity to install anything
Yes, it is necessary if you are going to connect java code with database. Do you have mysql-connector-java-5.0.5.jar file in your jdk lib.
Anyways, if not, download it and put it into the following locations: