try{System.out.println("consuccess1!");//注册数据提供程序Class.forName("org.objectweb.rmijdbc.Driver").newInstance();//数据链接字符串System.out.println("consuccess2!");St...
try {
System.out.println("con success1!");
// 注册数据提供程序
Class.forName("org.objectweb.rmijdbc.Driver").newInstance();
// 数据链接字符串
System.out.println("con success2!");
String strurl = "jdbc:rmi://10.192.140.223/jdbc:odbc:TEST";
// String strurl = "jdbc:rmi://localhost/jdbc:odbc:RollGate";
//10.192.140.223为access 数据库所在的服务器地址,ESD为odbc数据源名
System.out.println("strurl"+strurl);
con = DriverManager.getConnection(strurl,"","");
System.out.println("con success!"+con);
} catch(Exception e) {
e.printStackTrace();
}
**********************以上是我连接远程access数据库的代码******************
**********************以下是报错信息*******************************
java.rmi.ServerError: Error occurred in server thread; nested exception is:
java.lang.NoClassDefFoundError
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:255)
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:233)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:142)
at org.objectweb.rmijdbc.RJDriverServer_Stub.connect(Unknown Source)
at org.objectweb.rmijdbc.RJConnection.(RJConnection.java:51)
at org.objectweb.rmijdbc.Driver.connect(Driver.java:199)
at java.sql.DriverManager.getConnection(DriverManager.java:582)
at java.sql.DriverManager.getConnection(DriverManager.java:185)
at action.Rjdemo.main(Rjdemo.java:26)
Caused by: java.lang.NoClassDefFoundError
展开