I would like to connect to a database that I have locally. I have the service up, and I already have the base created.
as shown is localhost, root pass 1234,
and I have 2 user and oid tables,
I have the following Java class to use this base
private Persistencia() {
base = BaseDatos.getInstancia();
base.conectar("jdbc:mysql://localhost/dda", "root", "1234");
}
public void conectar(String url,String u,String p){
try {
conexion = DriverManager.getConnection(url, u, p);
stmt = conexion.createStatement();
} catch (SQLException ex) {
System.out.println("Error al conectar:" + ex.getMessage());
}
}
The error I have is the following:
Error when connecting: Not suitable driver found for jdbc: mysql: // localhost / dda