i work on project using intellij idea 15, so when i'm trying to connect to data base i got this error
No suitable driver found for jdbc:mysql://localhost:3306/egov
this is my datasource file
public class DataSource {
private String url;
private String login;
private String password;
private Connection connection;
private Properties properties;
private static DataSource instance;
private DataSource() {
try {
properties = new Properties();
properties.load(new FileInputStream(new File("configuration.properties")));
url = properties.getProperty("url");
login = properties.getProperty("login");
password = properties.getProperty("password");
connection = DriverManager.getConnection(url, login, password);
} catch (SQLException | IOException ex) {
System.out.println(ex.getMessage());
}
}
public Connection getConnection() {
return connection;
}
public static DataSource getInstance() {
if (instance == null) {
instance = new DataSource();
}
return instance;
}
}
and this is the configuration.properties file
url=jdbc:mysql://localhost:3306/egov
login=root
password=
and also i add the jar file mysql-connector-java any one know how to fix this problem