H
H
himmelcross2021-02-12 11:06:49
IntelliJ IDEA
himmelcross, 2021-02-12 11:06:49

How to specify db driver location in intellij idea 2020.3 environment?

Can't load mariadb database driver.
The .pom file has a dependency:

<dependency>
    <groupId>org.mariadb.jdbc</groupId>
    <artifactId>mariadb-java-client</artifactId>
    <version>2.7.2</version>
</dependency>

however, the servlet line
Class.forName(classDriver);
where throws an exception String classDriver = "org.mariadb.jdbc.Driver";

java.lang.ClassNotFoundException: org.mariadb.jdbc.Driver


At the same time, in the intellij idea 2020.3 environment, I connect to the mariadb database without any problems.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
gsaw, 2021-02-12
@gsaw

This dependency must be added to the CLASSPATH. Apparently intellij does it for you.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question