以下JAVA程序错误不明白,请专家解答
package javaexecise;
interface JDBC1{
public void 执行sql操作();
}
class Oracle implements JDBC1{
public void 执行sql操作(){
System.out.println("在Oracle上执行Sql语句");
}
}
class MySql implements JDBC1{
public void 执行sql操作(){
System.out.println("在MySql上执行Sql语句");
}
}
class DB2 implements JDBC1{
public void 执行sql操作(){
System.out.println("在DB2上执行Sql语句");
}
}
public class ClassForNameDemo{
public static void main(String arg[]) throws Exception{
Class jdbc类 = Class.forName(arg[0]);
JDBC1 jdbc = (JDBC1)jdbc类.newInstance();
jdbc.执行sql操作();
}
}
编译时错误:
at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:355)
at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at javaexecise.ClassForNameDemo.main(ClassForNameDemo.java:28)