eclipse链接access出现的问题
通过数据源链接
try {
Class.forName("sun.jdbc.odbc.JabdOdbcDriver");
con = DriverManager.getConnection("jdbc:odbc:tourist_access");
stmt = con.createStatement();
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (SQLException e) {
e.printStackTrace();
}
链接数据库,测试链接也是通的,但是进行
try {
rs = stmt.executeQuery( "select * FROM tourist WHERE touristID='123');
while (rs.next()) {
System.out.print(rs.getString("flightID"));
}
} catch (SQLException e)
会报错::
java.lang.ClassNotFoundException: sun.jdbc.odbc.JabdOdbcDriver
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
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:188)
是怎么回事啊啊啊啊啊