Compatibility issues with Oracle 10g and JDk1.6?

Hi. I am trying to make a database connection in Eclipse with Class.forName("oracle.jdbc.driver.OracleDriver") or DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver()). I have also added an external jar file classes12.jar but I am getting an exception :

java.lang.ClassNotFoundException: oracle.jdbc.Driver.OracleDriver
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at LoginDAO.(LoginDAO.java:9)
at Hello.doGet(Hello.java:30)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) .....

even if there is no compilation error. I am using Oracle 10g and JDK1.6 . Is there any need to include other jar files or configure anything else??? Please help.

Replies

  • Anand Tamariya
    Anand Tamariya
    It's clearly a classpath issue. Where have you added classes12.jar?
  • patil.ashu01
    patil.ashu01
    Anand Tamariya
    It's clearly a classpath issue. Where have you added classes12.jar?
    in eclipse through Configure build path-> add external jar files->select classes12.jar. this is displayed under libraries. I tried it this way that removed a compilation error in Class.forName() but gives an exception.
  • Anand Tamariya
    Anand Tamariya
    Put it in WEB-INF/lib folder.
  • patil.ashu01
    patil.ashu01
    I copied the file in WEB-INF/lib. bt getting the same exception
  • patil.ashu01
    patil.ashu01
    patil.ashu01
    I copied the file in WEB-INF/lib. bt getting the same exception
    I am using a tomcat server.. so is the problem arising due to oracle 10g,jdk1.6 and tomcat v6.0???? Please help.. I am stuck here..
  • patil.ashu01
    patil.ashu01
    patil.ashu01
    I copied the file in WEB-INF/lib. bt getting the same exception
    finally its done.... THANK YOU... As #-Link-Snipped-#, you said I had to set a classpath environmental variable. but I couldnt do it from cmd prompt but from my computer->manage->environmental variable. But both the methods do the same. rite??? then y cant i do it through cmd prompt???? And also classes12.jar file has to be included under WEB-INF/lib , otherwise an exception is raised. but this works with jboss by simply including jar files using Build path->configure build path->libraries->add external jars.
  • Anand Tamariya
    Anand Tamariya
    Variables set in a cmd prompt is only available in that session, one set via computer->manage->environmental variable is available to all new processes. Some server plugins in eclipse use the project classpath setting. Hence, you don't see the issue with JBoss. But it's not a fool-proof mechanism. For a web app, the proper way to provide for Jars is to put them under WEB-INF/lib.

You are reading an archived discussion.

Related Posts

i make small project myself using java. i have created many frame in a many classes. so i need to open sup window(sup frame) at the time of main window(main...
This is an old one that came up during Lyndon's presidential term. LYNDON X B = JOHNSON Each letter stands for a unique digit zero to nine. When the letters...
CEans, We're super excited to announce the launch of mobile optimised version of CrazyEngineers! The mobile optimised layout was one of the top requests made by CEans. The wait is...
Kaustubh Katdare i am going to take isro cs exam on may 12th 2013... please give me information about the exam pattern...
The usual and uncomfortable treatment for the condition commonly called 'Lazy Eye' (medically amblyopia) is to put a patch on the normal eye to force the other to get regular...