I'm having a problem connecting my from Java in Netbeans with mariadb in localhost. I've been seeing some post like this Connect to MariaDB from Java application in NetBeans on Linux (Mageia) but doesn't work it's pretty similar so I don't know why this post can't help me.
public BD(String servidor, String database, String usuario, String password) throws SQLException{
try {
Class.forName("org.mariadb.jdbc.Driver");
url="jdbc:mysql://localhost/ddsi";
conexion=DriverManager.getConnection(url, usuario, password);
System.out.println("Conexion a Base de Datos "+url+" . . . . .Ok");
}
catch (ClassNotFoundException ex) {
System.out.println(ex);
}
}
As in the previous link I've tried everything. I also have mariadb library.
I checked skip-networking directive in /etc/my.cnf but it is already commented.