Re: Accessing a local 7.3 database from within a java applet

From: Stann Sicade <ssicade_at_gte.net>
Date: 16 Aug 1998 18:31:31 GMT
Message-ID: <6r78i3$l57$1_at_news-2.news.gte.net>


John,

        This looks like a java error to me.

        NoClassDefFoundError: oracle/jdbc/driver/OracleDriver

tells me java cannot find OracleDriver.class

Do you have CLASSPATH pointing to your driver?

                                Stann :)

John Griffin <jgriffin_at_boyne.u-net.com> wrote in article <35D3FB91.9142FA53_at_boyne.u-net.com>...
> When trying to run the applet (below) from within either Netscape or
> Internet Explorer, the applet runs but the database access fails raising
> the following exception:
>
> Error: java.lang.NoClassDefFoundError: oracle/jdbc/driver/OracleDriver
>
> I can however successfully run this as an application and using the
> appletviewer so it seems to be a problem with the browser
> configurations. Is their a "classpath" setting for the browser? Can
> someone please help?
>
>
> import java.applet.Applet;
> import java.awt.Graphics;
> import java.sql.*;
> import java.math.*;
> import java.io.*;
> import java.util.*;
>
> public class Welcome extends Applet {
>
> // The driver to load
> static final String driver_class = "oracle.jdbc.driver.OracleDriver";
>
> // The connection to the database
> Connection conn;
>
> String output_text = "";
>
> //Initialize the applet
> public void init () {
> try { xInit(); } catch (Exception e) { output_text =
> e.getMessage(); } finally { if (output_text == "") output_text =
> "Failure!"; }
> }
>
> //Component initialization
> public void xInit() throws Exception {
>
> DriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver
> ());
> Connection conn =
> DriverManager.getConnection("jdbc:oracle:thin:_at_127.0.0.1:1521:orcl",
> "griffj01", "griffj01");
>
> // Query the employee names
> Statement stmt = conn.createStatement ();
> ResultSet rset = stmt.executeQuery ("select 'Welcome to '||value
> from byn_system_parameters where name = 'COMPANY_NAME'");
>
> while (rset.next ())
> output_text = rset.getString (1);
> }
>
> public void paint (Graphics g) {
> g.drawString ("Retrieving ...", 25, 25);
> g.drawString ("Result: " + output_text, 25, 40);
> }
> }
>
>
>
>
Received on Sun Aug 16 1998 - 20:31:31 CEST

Original text of this message