-
Bug
-
Resolution: Won't Fix
-
P3
-
None
-
1.2.1
-
x86
-
windows_nt
The following applet is unable to load sun.jdbc.odbc.JdbcOdbcDriver
via Class.forName with Java Plug-In 1.2.1. This code works properly
when loaded with the 1.1 JVM, and works intermittently with the appletviewer from JDK 1.2.1.
//import java.applet.Applet;
import javax.swing.*;
import java.awt.*;
public class driver extends JApplet {
public void init() {
getContentPane().setLayout(null);
setSize(426,266);
String driverClass = "sun.jdbc.odbc.JdbcOdbcDriver";
try {
Class.forName(driverClass).newInstance();
System.out.println("Class " + driverClass + " was found OK");
} catch( Exception e) {
System.out.println("Class " + driverClass + " was not found");
}
driverClass = "javax.swing.JApplet";
try {
Class.forName(driverClass).newInstance();
System.out.println("Class " + driverClass + " was found OK");
} catch( Exception e) {
System.out.println("Class " + driverClass + " was not found");
}
}
}
Output when the applet fails:
% appletviewer driver-noplugin.html
Class sun.jdbc.odbc.JdbcOdbcDriver was not found
Class javax.swing.JApplet was found OK
%
Expected output:
% appletviewer driver-noplugin.html
Class sun.jdbc.odbc.JdbcOdbcDriver was found OK
Class javax.swing.JApplet was found OK
%
via Class.forName with Java Plug-In 1.2.1. This code works properly
when loaded with the 1.1 JVM, and works intermittently with the appletviewer from JDK 1.2.1.
//import java.applet.Applet;
import javax.swing.*;
import java.awt.*;
public class driver extends JApplet {
public void init() {
getContentPane().setLayout(null);
setSize(426,266);
String driverClass = "sun.jdbc.odbc.JdbcOdbcDriver";
try {
Class.forName(driverClass).newInstance();
System.out.println("Class " + driverClass + " was found OK");
} catch( Exception e) {
System.out.println("Class " + driverClass + " was not found");
}
driverClass = "javax.swing.JApplet";
try {
Class.forName(driverClass).newInstance();
System.out.println("Class " + driverClass + " was found OK");
} catch( Exception e) {
System.out.println("Class " + driverClass + " was not found");
}
}
}
Output when the applet fails:
% appletviewer driver-noplugin.html
Class sun.jdbc.odbc.JdbcOdbcDriver was not found
Class javax.swing.JApplet was found OK
%
Expected output:
% appletviewer driver-noplugin.html
Class sun.jdbc.odbc.JdbcOdbcDriver was found OK
Class javax.swing.JApplet was found OK
%