RMIJDBC HELP
hi,
i want to get the result of a sql query from database (MS Access) present at the remote machine. I downloaded rmijdbc wid the server (daemon). And when i compile the below code using JDK 1.5 i get the error CLASSNOTFOUND : org.objectweb.rmijdbc.Driver.
import java.sql.*;
import java.net.InetAddress;
public class TestClient {
public static void main(String args[]) {
try {
Class.forName("org.objectweb.rmijdbc.Driver").newInstance();
String url = "jdbc:idb:sample.prp";
String portSpec = "";
if(args.length > 0) {
Integer.parseInt(args[0]); // Check port number is an integer
portSpec = new String(":" + args[0]);
}
String rmiHost = new String(
"//" + InetAddress.getLocalHost().getHostName() + portSpec);
String jurl = "jdbc:rmi:" + rmiHost + "/" + url;
System.out.println("TestClient:" + jurl);
Connection c = DriverManager.getConnection(jurl);
Statement st = c.createStatement();
ResultSet rs = st.executeQuery("select * from import1");
ResultSetMetaData md = rs.getMetaData();
while(rs.next()) {
System.out.print("\nTUPLE: | ");
for(int i=1; i<= md.getColumnCount(); i++) {
System.out.print(rs.getString(i) + " | ");
}
}
rs.close();
} catch(Exception e) {
e.printStackTrace();
}
}
};
Please help me solve this problem
Dinesh Chandrasekaran

