0

I'm new to programming and just started learning basic requesting/responding between servlet, jsp and html.

I never made an web project with intellij (used to use Eclipse) so struggling with adding library and etc..Since I've eventually connected to Tomcat, now server is okay to run. However, my servlet file doesn't reach to ojdbc6.jar which is added to External library.

Servlet is simple to check the connection. Like below.

        ...

    try {

        System.out.println("<--try-->");
        conn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:orclKOSMO00", "csi00", "csi1234");

        System.out.println("<--stmt-->");
        stmt = conn.prepareStatement("SELECT * FROM MEMBER");

        System.out.println("<--resultSet-->");
        resultSet = stmt.executeQuery();

        System.out.println("<--Done-->");

It has an error saying java.sql.SQLException: No suitable driver found for jdbc:oracle:thin:@localhost:1521:orclKOSMO00

I tried Class.forName("oracle.jdbc.driver.OracleDriver"); before connection. And then, it said java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver So, I assume it can't reach the library or jar file.

I barely know bout paths or how the project is structured. It should be very simple thing about configuration of intelliJ that I had to set but I missed.


  • Version of intellij is ultimate not the one with fully licensed so has been added plugins to connect Oracle and Tomcat.

  • Screenshot may help to let you get understood a bit better.

Mark Rotteveel
  • 90,369
  • 161
  • 124
  • 175
Sophie
  • 1
  • You need to add the Oracle JDBC driver to the classpath of your application. How to do that depends on whether you use Maven, Gradle, or another build tool, or rely on IntelliJ to define the classpath. The screenshot seems to indicate you use Maven. – Mark Rotteveel Sep 18 '21 at 13:32

0 Answers0