Results 1 to 2 of 2
  1. #1
    abrahamthomas is offline Member
    Join Date
    Jul 2012
    Rep Power

    Default OJDBC connection error

    I am using Oracle 11g and java 1.7.
    When i am trying to connect, it is throwing classnot found exception.

    my code:
    DriverManager.registerDriver(new oracle.jdbc.OracleDriver());

    con=DriverManager.getConnection("jdbc:oracle:thin: @","system", "password");


    SEVERE: Servlet.service() for servlet Login_Servlet threw exception
    java.lang.NoClassDefFoundError: oracle/jdbc/OracleDriver
    at container.JdbcConnection.Connections.connections(C
    at container.persistance.Login_Retrive_Details.valida teUser(
    at container.servlet.Login_Servlet.doPost(Login_Servl
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:637)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:717)
    at ternalDoFilter(
    at Filter(
    at org.apache.catalina.core.StandardWrapperValve.invo ke(
    at org.apache.catalina.core.StandardContextValve.invo ke(
    at org.apache.catalina.core.StandardHostValve.invoke(
    at org.apache.catalina.valves.ErrorReportValve.invoke (
    at org.apache.catalina.core.StandardEngineValve.invok e(
    at org.apache.catalina.connector.CoyoteAdapter.servic e(
    at org.apache.coyote.http11.Http11Processor.process(H
    at org.apache.coyote.http11.Http11Protocol$Http11Conn ectionHandler.process(
    at Source)

    ps: i am running from eclipse

    i have verified my class path throuch command line its working as expected.
    In my classpath i havd ojdb14,5,6,6_g.
    also added the build path in eclipse to the same jars.

    please help..........

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Rep Power

    Default Re: OJDBC connection error

    How are you running the above code?
    Because, whatever you say aside, you do not have the ojdbc jar file (and you only want the one, not every one you can get your hands on) in your runtime classpath.

    By the way, there is no need to register the driver these days. Haven't needed to do that since (I think) 1.5.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

Similar Threads

  1. error with connection Mysql
    By ahmadn in forum Java Applets
    Replies: 5
    Last Post: 06-17-2011, 11:54 AM
  2. I/O Error: Connection reset...
    By dkennelly in forum Java Servlet
    Replies: 5
    Last Post: 09-17-2010, 04:12 PM
  3. error in Connection
    By sabra in forum JDBC
    Replies: 1
    Last Post: 06-12-2010, 01:02 PM
  4. Connection Error
    By meMalik in forum JavaServer Faces (JSF)
    Replies: 1
    Last Post: 02-22-2010, 07:13 PM
  5. error I/O connection
    By bbq in forum JDBC
    Replies: 1
    Last Post: 07-05-2007, 02:33 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts