In my simplest training application I have to create Class DbConnector.class which is returning mysql DB connection. I'm calling this class from LoginManager.class where I'm checking username and password. Runnig in Eclipse console and it's working properly. After that I made export my project into connector.jar file.
Now I create a new tomcat project and add this connector.jar into the buildpath. In class LoginServlet I made import of connector and calling LoginManager.class. So when I'm calling LoginServlet from login.jsp file I'm getting error
"com.mysql.jdbc.CommunicationsException: Communications link failure"
Driver loaded, but cannot connect to db: jdbc:mysql://localhost:3306/bill_base?useUnicode=yes&characterEncoding=utf-8
Below please find source of DbConnector, LoginManager,LoginServlet and login.jsp