I have used below java code to connect to oracle database
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","system","root");
My java version is "18.0.1.1".
My oracle version is 11.2g. I added the ojdbc6.jar and ojdbc6_g.jar to the path C:\Program Files\Java\jdk-18.0.1.1\lib.
I have added java bin and lib folder path to system variables under path
But still when I try to run the program, I am getting the below error: ClassNotFoundException: oracle.jdbc.driver.OracleDriver.
Can anyone please help me to solve the problem. I tried all possible ways from stackoverflow and other resources but couldn't solve the issue.