Win a copy of JDBC Workbook this week in the JDBC and Relational Databases forum
or A Day in Code in the A Day in Code forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

java.lang.NoClassDefFoundError: oracle/jdbc/OracleDriver

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I havae a problem with a applet jdbc program i java, whe i tried to run i have the next error message:

java.lang.NoClassDefFoundError: oracle/jdbc/OracleDriver
at Principal.actionPerformed(Principal.java:97)
at java.awt.Button.processActionEvent(Button.java:382)
at java.awt.Button.processEvent(Button.java:350)
at java.awt.Component.dispatchEventImpl(Component.java:3615)
at java.awt.Component.dispatchEvent(Component.java:3477)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:480)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
read.java:201)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
ad.java:151)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)

at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)

at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)




The principal programa that i have:

import java.awt.*;
import java.applet.*;
import java.awt.event.*;
import java.io.File;
//import java.io.*;
import java.sql.*;
//
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
//import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.net.MalformedURLException;
import java.net.Socket;
import java.util.StringTokenizer;

import java.util.*;
import java.io.*;
import oracle.jdbc.*;





// <applet width="150" height="200" code="AppletEventos1"></applet>

public class Principal extends Applet implements ActionListener {

Label l1, l2;
TextField t1,t2;
Button b;
Button b2;
Button b3;

String v_file;
private int numClicks = 0;
public ftp2 ftp;
//public Procesa procesa;
public Carga carga;

Procesa procesa = new Procesa();
public Principal()
{
l1 = new Label("Numero");
t1 = new TextField(8);
l2 = new Label("Suma");
t2 = new TextField(8);
b = new Button("Envia");
b2 = new Button("Carga");
b3 = new Button("Procesa");

//add(l1);
//add(t1);
add(b);
add(b2);
add(l2);
add(t2);
add(b3);

b. addActionListener(this);
b2. addActionListener(this);
b3. addActionListener(this);
}//AppletEventos1()


public void actionPerformed(ActionEvent e)
{
//
Button boton = (Button)e.getSource();
if (boton == b)
{
numClicks++;
t2.setText("Button Clicked ");
}
else { //e1
if (boton == b2)
{
t2.setText("Button Carga Archivo");
v_file ="winzip.log";
ftp.uploadFileToFTP("10.94.194.66","goauser","904us3r01","/usr/local/apache2/htdocs/oap/reportesIOM/Eq_no_fact/data", new File("c:\\" + v_file),true);
try
{
carga.ejecuta();
} catch (SQLException err) {}

}
else
{ //e2
if (boton == b3)
{
t2.setText("Carga Tabla");

try
{
procesa.proces();
} catch (SQLException er) {System.out.println(e.toString());

}
}
}//e2
} //e1
}//actionPerformed

where procesa.proces(); is

import java.sql.*;
import java.util.*;
import java.io.*;
import oracle.jdbc.*;
import java.math.*;


class Procesa {

public static void proces() throws SQLException
{

DriverManager.registerDriver
/// (new oracle.jdbc.driver.OracleDriver());
(new oracle.jdbc.OracleDriver());

try { //try1

//edita la coneccion para el insert a tabla
Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@10.77.18.54:1521:i","i","i");
/********************BORRA TABLA***************************/
try
{
String sql = "select order_id,order_status from prov_order where order_id = 97813 ";
Statement stmtdate = conn.createStatement();
ResultSet rset = stmtdate.executeQuery(sql);
//stmtdate.execute (sql);
while (rset.next ())
{
//System.out.println (rset.getString (1));

String order_id = rset.getString ("order_id");
String order_status = rset.getString ("order_status");

System.out.println (order_id);
System.out.println (order_status);
String sql_u = ("update prov_order set sys_comments ='6' where order_id = "+ order_id);
Statement pstmt3 = conn.createStatement();
pstmt3.executeQuery(sql_u);



// close the result set, the statement and connect
System.out.println("Concluido");
//stmt = null;
}
rset.close();
rset = null;
stmtdate.close();

}
catch (SQLException e)
{
// Ignore an error here
}
/********************BORRA TABLA hasta aqui***************************/

} //try1
catch (SQLException e) {
System.out.println(e);
// it'll throw an error of the table doesn't exist in many JDBC drivers
;
}


}//public process

public static void main(String[] args) throws SQLException
{
proces();
}



} //clase


}//class


Thanks for all.


 
Those cherries would go best on cherry cheesecake. Don't put those cherries on this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic