ClassNotFoundException: oracle.jdbc.driver.OracleDriver - JDBC JAVA

This is a discussion on ClassNotFoundException: oracle.jdbc.driver.OracleDriver - JDBC JAVA ; Hi. I try play a little bit with a oracle, tomcat, apache. I setup apache, tomcat, and the oracle 10g. Now I try login to my database by website using jsp files. Base on website : http://elab.bus.umich.edu/how-to-oracle-jsp.php I made the ...

+ Reply to Thread
Results 1 to 3 of 3

ClassNotFoundException: oracle.jdbc.driver.OracleDriver

  1. Default ClassNotFoundException: oracle.jdbc.driver.OracleDriver

    Hi.
    I try play a little bit with a oracle, tomcat, apache. I setup apache,
    tomcat, and the oracle 10g. Now I try login to my database by website using
    jsp files.
    Base on website : http://elab.bus.umich.edu/how-to-oracle-jsp.php
    I made the page to pull up some records - just to see if this works.
    When I point in the webbrowser to this file i receive error:

    ClassNotFoundException: oracle.jdbc.driver.OracleDriver

    When I am login on that server I can use sqlplus.
    What could be problem?
    I use a debian system with oracle10g, tomcat 5.5.9 and jdk1.5.

    Please point me to some useful documents, examples.
    Thanks for help.
    Mariusz

    Here is a code what I used:

    <%@ page import="java.sql.*" %>
    <HTML>
    <HEAD><TITLE>Simple Oracle Example</TITLE></HEAD>
    <BODY BGCOLOR="#FFFFFF">
    <CENTER>
    <B>Employees</B>
    <BR><BR>

    <%
    Connection conn = null;
    try
    {
    Class.forName("oracle.jdbc.driver.OracleDriver");

    conn = DriverManager.getConnection(
    "jdbcracle:thin:@192.168.1.20:1521rcl",
    "orauser",
    "2005or");

    Statement stmt = conn.createStatement();
    ResultSet rs = stmt.executeQuery("SELECT * FROM NMS_DATA");

    //Print start of table and column headers
    out.println("<TABLE CELLSPACING=\"0\" CELLPADDING=\"3\"
    BORDER=\"1\">");
    out.println("<TR><TH>ID</TH><TH>NAME</TH></TR>");

    //Loop through results of query.
    while(rs.next())
    {
    out.println("<TR>");
    out.println("<TD>" + rs.getString("EmpID") + "</TD>");
    out.println("<TD>" + rs.getString("Name") + "</TD>");
    out.println("</TR>");
    }

    out.println("</TABLE>");
    }
    catch(SQLException e)
    {
    out.println("SQLException: " + e.getMessage() + "<BR>");
    while((e = e.getNextException()) != null)
    out.println(e.getMessage() + "<BR>");
    }
    catch(ClassNotFoundException e)
    {
    out.println("ClassNotFoundException: " + e.getMessage() + "<BR>");
    }
    finally
    {
    //Clean up resources, close the connection.
    if(conn != null)
    {
    try
    {
    conn.close();
    }
    catch (Exception ignored) {}
    }
    }
    %>

    </CENTER>
    </BODY>
    </HTML>

  2. Default Re: ClassNotFoundException: oracle.jdbc.driver.OracleDriver

    kajko wrote:
    >
    > Hi.
    > I try play a little bit with a oracle, tomcat, apache. I setup apache,
    > tomcat, and the oracle 10g. Now I try login to my database by website using
    > jsp files.
    > Base on website : http://elab.bus.umich.edu/how-to-oracle-jsp.php
    > I made the page to pull up some records - just to see if this works.
    > When I point in the webbrowser to this file i receive error:
    >
    > ClassNotFoundException: oracle.jdbc.driver.OracleDriver
    >
    > When I am login on that server I can use sqlplus.
    > What could be problem?
    > I use a debian system with oracle10g, tomcat 5.5.9 and jdk1.5.
    >
    > Please point me to some useful documents, examples.
    > Thanks for help.


    You need to put the JDBC Driver jar/zip in the standard shared library for Tomcat. I
    don't what that is, however. It can also be put in common jars under lib/ext or
    jre/lib/ext for your JVM.

    --
    Lee Fesperman, FFE Software, Inc. (http://www.firstsql.com)
    ==============================================================
    * The Ultimate DBMS is here!
    * FirstSQL/J Object/Relational DBMS (http://www.firstsql.com)

  3. Default Re: ClassNotFoundException: oracle.jdbc.driver.OracleDriver

    Lee Fesperman wrote:
    >
    > kajko wrote:
    > >
    > > Hi.
    > > I try play a little bit with a oracle, tomcat, apache. I setup apache,
    > > tomcat, and the oracle 10g. Now I try login to my database by website using
    > > jsp files.
    > > Base on website : http://elab.bus.umich.edu/how-to-oracle-jsp.php
    > > I made the page to pull up some records - just to see if this works.
    > > When I point in the webbrowser to this file i receive error:
    > >
    > > ClassNotFoundException: oracle.jdbc.driver.OracleDriver
    > >
    > > When I am login on that server I can use sqlplus.
    > > What could be problem?
    > > I use a debian system with oracle10g, tomcat 5.5.9 and jdk1.5.
    > >
    > > Please point me to some useful documents, examples.
    > > Thanks for help.

    >
    > You need to put the JDBC Driver jar/zip in the standard shared library for Tomcat. I
    > don't what that is, however. It can also be put in common jars under lib/ext or
    > jre/lib/ext for your JVM.


    Got it! For Tomcat, place JDBC driver jar/zip's in common/lib or shared/lib. See "Class
    Loader HOW-TO" in the Tomcat docs.

    --
    Lee Fesperman, FFE Software, Inc. (http://www.firstsql.com)
    ==============================================================
    * The Ultimate DBMS is here!
    * FirstSQL/J Object/Relational DBMS (http://www.firstsql.com)

+ Reply to Thread

Similar Threads

  1. java.lang.AbstractMethodError: oracle.jdbc.driver.OracleResultSetImpl.
    By Application Development in forum JDBC JAVA
    Replies: 0
    Last Post: 06-30-2006, 05:19 AM
  2. Oracle Thin JDBC Driver Problem - Run time
    By Application Development in forum JDBC JAVA
    Replies: 8
    Last Post: 02-16-2006, 11:00 PM
  3. jdbc driver not found in simple java program for personal Oracle
    By Application Development in forum JDBC JAVA
    Replies: 1
    Last Post: 05-05-2005, 12:43 AM
  4. Class.forName hang initializing oracle.jdbc.OracleDriver
    By Application Development in forum JDBC JAVA
    Replies: 1
    Last Post: 02-07-2005, 09:40 PM
  5. Hibernate not finding Oracle driver - despite straight JDBC working
    By Application Development in forum JDBC JAVA
    Replies: 7
    Last Post: 12-23-2004, 06:44 AM