A ClassNotFundExxseption error occurs when the registration and initialization command is executed

34 views Asked by At

I have java project JavaProject4. In folder lib, I added file postgresql-42.2.2.jre7.jar (postgres driver). Next, I execute the following command:

Class.forName("org.postgresql.Driver").newInstance();

The command terminates with an error:

type: ClassNotFoundException detailMessage: "org.postgresql.Driver"

Question: how do I fix this error?

P.S. I'm a little versed in Java and the development environment of Netbeans. enter image description here

0

There are 0 answers