File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Distributed Java and the fly likes RMI JDBC  SQLException: No suitable driver Class not found Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "RMI JDBC  SQLException: No suitable driver Class not found" Watch "RMI JDBC  SQLException: No suitable driver Class not found" New topic
Author

RMI JDBC SQLException: No suitable driver Class not found

Ray Smilgius
Ranch Hand

Joined: Jan 29, 2001
Posts: 120
At the DOS screen:::::::::::::::::::::::::::::::::::::::::::::
C:\joeramilo\getData>java -Djava.security.policy=C:\joeramilo\getData\rmipermit.policy rmiServer
RMI Server awaiting clients
RmiJdbc.RJDriver: ClassNotFoundException: No driver loaded or found
SQLException: ** Error on data insert. **
SQLException: No suitable driver
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

Here is the code and mypermit policy info::::::::Windows 2000
Any help greatly appreciated.
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
grant
{
permission java.security.AllPermissions;
permission java.net.SocketPermission"*:1024-65535","connect,accept,resolve";
permission java.net.SocketPermission"*:1-1023","connect,resolve";
permission java.lang.RuntimePermission"accessClassInPackage.sun.jdbc.odbc";
permission java.io.FilePermission"c://joeramilo//getData//flight.mdb", "read,write";
};
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Here is the code that is flopping......
I have installed the C:\jdk1.3.1_01\jre\lib\ext\RmiJdbc.jar
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.sql.*;
import java.util.*;
import java.rmi.*;
import RmiJdbc.*;
import java.net.InetAddress;
import java.net.*;

public class................
.....
public Vector getDestination()
{


String userlogin;
Vector temp = new Vector(1,1);
String[] joe;
Connection con;

try {
Class.forName("RmiJdbc.RJDriver").newInstance();

}
catch(java.lang.ClassNotFoundException e)
{
System.err.println(e.getMessage());
System.err.print("ClassNotFoundException: ");
System.err.println("No driver loaded or found");
}
catch(Exception e)
{

System.err.println("another exception"+e.getMessage());
}
try {

// RMI host will point to local host
String url = "jdbc dbc:getData";
String rmiHost = new String("//" + netAddress.getLocalHost().getHostName());
java.sql.Connection c = DriverManager.getConnection("jdbc:rmi:"+ rmiHost + "/" + url);
java.sql.Statement st = c.createStatement();
java.sql.ResultSet rs = st.executeQuery("SELECT Destination FROM flightone");
java.sql.ResultSetMetaData md = rs.getMetaData();



temp.add("chicago");
temp.add("new york");


st.close();
c.close();

}
catch(SQLException ex)
{
System.err.println("SQLException: ** Error on data insert. **");
System.err.println("SQLException: "+ ex.getMessage());
}
catch(Exception ex)
{
System.out.println(ex.getMessage());
}

return temp;
}

Thanks in Advance
Ray Smilgius


SCJO, SCJD, SCWCD, I-Net+, A+, Network+, MCSD, MCDBA, MCP, MCT
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: RMI JDBC SQLException: No suitable driver Class not found