Sai Sankalp Sai Sankalp - 1 month ago 6x
Java Question

Eclipse:Dynamic Web Project Is it Mandatory to include OJDBC.jar file in WEB-INF?

Recently While I was doing a Dynamic web project,I forgot to include OJDBC.jar in the WEB-INF folder.But the code ran file without showing any Class Not Found Exception.But when my friend did the same,Class not found exception was shown.Then when he included the OJDBC.jar in the WEB-INF folder,the code ran fine.I am not able to understand why this is the case.Is it not mandatory to include OJDBC file in WEB-INF folder?And we both used Apache Tomcat Server.enter image description here

As you can see from the above screenshot,I experimented by not including OJDBC.jar in the WEB-INF folder.The code ran fine.Please tell me why this is the case?


Well, Eclipse builds the context's classpath joining libraries from several locations:

  • Of corse, the <tomcat_home>\lib\*.jar files.
  • The <project>\WEB-INF\lib\*.jar files.
  • ... and also the deployment assembly entries (within the project's properties).

Check out every one of these and compare with your partner ones.