I am using tomcat 5.5 and I am unable to connect to mysql server(Wamp2.0i).

Here is my code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 

<%@ page import="java.sql.*"%>
<%@ page import="java.io.*"%> 

<title>Connection with mysql database</title>
<h1>Connection status</h1>
	    String connectionURL = "jdbc:mysql://localhost:3306/names";

		Connection connection = null;

		connection = DriverManager.getConnection(connectionURL,"root","");

		if (!connection.isClosed())
			out.print("Connection established");
			out.print("Error ... in getting a Connection");


I have installed the drivers mysql-connector-java jars(2.0.14,3.0.16,3.1.7,5.1.12) in WEB-INF/lib of the folder,in java build path and tomcat/lib.

I am getting the exception

java.sql.SQLException: Cannot connect to MySQL server on localhost:3306. Is there a MySQL server running on the machine/port you are trying to connect to? (java.lang.NumberFormatException)

Please help.