I started learning SQl, I chose PostgreSQL as the experimental database. During the preparation, one problem emerged - I don’t understand how to connect the driver, the program doesn’t want to see its class, although it lies in the driver. I imported the driver library, ticked Export in modules, but I don’t want to work anyway. The driver downloaded from off. site, version 41 because it seems to be written that it is under Java 8. Help me figure out where to poke for it to work, not for nothing that I bought books. :(
To check the work-ability using the following code:
public class Eye { public static void main(String[] args) { try { Class.forName("org.posgresql.Driver"); System.out.println("Driver loading success!"); } catch (ClassNotFoundException e) { e.printStackTrace(); } } After compiling produces the following:
java.lang.ClassNotFoundException: org.posgresql.Driver at java.net.URLClassLoader$1.run(URLClassLoader.java:372) at java.net.URLClassLoader$1.run(URLClassLoader.java:361) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:360) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:259) at Eye.main(Eye.java:8) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134) Process finished with exit code 0