This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Applets and the fly likes java.lang.NoClassDefFoundError: oracle/jdbc/OracleDriver Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "java.lang.NoClassDefFoundError: oracle/jdbc/OracleDriver" Watch "java.lang.NoClassDefFoundError: oracle/jdbc/OracleDriver" New topic
Author

java.lang.NoClassDefFoundError: oracle/jdbc/OracleDriver

Alfredo Perz
Greenhorn

Joined: Feb 01, 2012
Posts: 1
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("jdbcracle: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.


 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java.lang.NoClassDefFoundError: oracle/jdbc/OracleDriver