CrazyEngineers
  • Compatibility issues with Oracle 10g and JDk1.6?

    Updated: Oct 21, 2024
    Views: 1.1K
    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.<init>(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.
    0
    Replies
Howdy guest!
Dear guest, you must be logged-in to participate on CrazyEngineers. We would love to have you as a member of our community. Consider creating an account or login.
Replies
  • Anand Tamariya

    MemberApr 24, 2013

    It's clearly a classpath issue. Where have you added classes12.jar?
    Are you sure? This action cannot be undone.
    Cancel
  • patil.ashu01

    MemberApr 24, 2013

    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.
    Are you sure? This action cannot be undone.
    Cancel
  • Anand Tamariya

    MemberApr 25, 2013

    Put it in WEB-INF/lib folder.
    Are you sure? This action cannot be undone.
    Cancel
  • patil.ashu01

    MemberApr 26, 2013

    I copied the file in WEB-INF/lib. bt getting the same exception
    Are you sure? This action cannot be undone.
    Cancel
  • patil.ashu01

    MemberApr 26, 2013

    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..
    Are you sure? This action cannot be undone.
    Cancel
  • patil.ashu01

    MemberApr 26, 2013

    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.
    Are you sure? This action cannot be undone.
    Cancel
  • Anand Tamariya

    MemberApr 27, 2013

    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.
    Are you sure? This action cannot be undone.
    Cancel
Home Channels Search Login Register