I think the problem is you are putting mysql-connector-java-5.1.18-bin file rather you have to put "mysql-connector-java-5.0.5.jar" file there.
i have made a web application in eclipse(IDE). so if you are making a web application on eclipse(IDE) then you can put "mysql-connector-java-5.0.5.jar" in the lib folder.
below is the path where i put my "mysql-connector-java-5.0.5.jar" file...
C:\Users\Abhishek\workspace\MyProject\WebContent\WEB-INF\lib\mysql-connector-java-5.0.5.jar