I am new to java based web service. I am able to create web service in java. I am made connection using ODBC connection to MySQL. I want to make connection using JDBC connection.
For that I included jar file (mysqlconnector.jar) in Build Path of project in Eclipse.
The problem is that it throws a ClassNotFoundException at the line where I used class of that jar file.
String URL = "jdbc:mysql://localhost:3306/dbName";
String USER = "root";
String PASSWORD = "abc@123";
String DRIVER = "com.mysql.jdbc.Driver";// driver from the jar file
Class.forName(DRIVER);//gives exception here
con = DriverManager.getConnection(URL, USER, PASSWORD);//return null here
The required API also required at runtime, put it into
WEB-INF/lib