I'm using the mariadb-java-client-1.5.7.jar
connector for MariaDB, and it does not work.
Here's the connection code:
public DataAccess() throws SQLException, ClassNotFoundException {
this.driver = "org.mariadb.jdbc.Driver";
this.host = "jdbc:mariadb://localhost/bluebank";
this.user = "root";
this.password = "";
Class.forName(this.driver);
this.conn = DriverManager.getConnection(this.host, this.user, this.password);
}
I get:
java.sql.SQLException: No suitable driver found for jdbc:mariadb://localhost/bluebank
at java.sql.DriverManager.getConnection(DriverManager.java:689)
at java.sql.DriverManager.getConnection(DriverManager.java:247)
at DAO.DataAccess.<init>(DataAccess.java:31)
Apart from adding as an external jar to the libraries, I've added it as a driver to the databases in (Services) in Netbeans. Also, if I remove the Class.forName()
, it doesn't work as well.