我曾尝试使用Netbeans 8加载JdbcOdbcDriver,但我收到了以下错误(包含错误消息)。可以帮我解决这个问题吗?解释如何在Net beans 8中添加库。
import java.io.*;
import java.sql.*;
public class test {
public static void main(String [] args)
{
try
{
System.out.println("JDBC-ODBC driver loading......");
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver") ;
System.out.println("JDBC-ODBC driver loaded ok.");
} catch(Exception ex)
{
ex.printStackTrace();
}
}
}
ERROR :
run:
JDBC-ODBC driver loading......
java.lang.ClassNotFoundException: sun.jdbc.odbc.JdbcOdbcDriver
at java.net.URLClassLoader$1.run(URLClassLoader.java:359)
at java.net.URLClassLoader$1.run(URLClassLoader.java:348)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:347)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:258)
at abd.pkg1.test.main(test.java:14)
BUILD SUCCESSFUL (total time: 1 second)