I just purchased a hosting service and added my J2EE web project via cpanel and successfully created a database in MySQL. But I am facing a problem in creating a JDBC connection with cpanel. It says "No suitable driver found for localhost". I guess cpanel is not able to detect the MySQL J connector in web-inf/lib
- but why???
Is their something else to be done to run it? I am new to cpanel. Here is my connection class
public class DbConnection {
private static Connection connection;
public static Connection getConnection()
{
return connection;
}
static
{
try {
Class.forName("com.mysql.jdbc.Driver");
} catch (ClassNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
try {
connection = DriverManager.getConnection("localhost","abcas","*******");
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}