Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SLQException No suitable driver (08001)

Status
Not open for further replies.

porto2001

Programmer
Mar 7, 2001
24
PT

SQL Exception No suitable driver.

This is my code:

try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
}catch(Exception e){
setError("Can´t find database driver class: "+e);
return;
}

try{
String url="jdbc:eek:dbc:HumanResources";
java.sql.Connection c = DriverManager.getConnection(url,"admin","hr");

java.sql.Statement st = c.createStatement();
java.sql.ResultSet rs = st.executeQuery("select * from HRMHR");
java.sql.ResultSetMetaData md = rs.getMetaData();

rs.close();
c.close();

}catch(SQLException ee){
setError("SQLException "+ee.getSQLState());
}

The message of getSQLState is 08001

I´m using Windows2000, IIS, and a MSAccess database.

With applet viewer works fine, but with a browser, SQLException appears.

I don´t know if it´s the security policy, or some problems with system dns or file dns.
If the problem is file dns, please help, cause i really don´t understaind much of it.
 
Yep, it's an applet issue. Try adding the JAVA_HOME/jre/lib/rt.jar to your system classpath so IE can find it. That's where the sun jdbc driver is. Remember though, that applets can only open connections to the server from which the applet was retrieved.

Charles
 
i have try it, but it still don´t work...
i am desperated

i have the sun/jdbc/odbc/*.class in my InetPub/ i have try to put the database file in InetPub/
i am trying to run the applet in the same computer where IIS is installed.

In Nestscape 6 the exception is java.security.AccessControlException: Access denied

i really need help....
 
If you really want it to get it done, and you don't care about security settings, do this:-

Go to these 2 directories:-
c:\program files\javasoft\jre\1.3\lib\securityc:\jdk1.3\jre\lib\security
There should be this file in both of the directory:-
java.policy

Open up this file using notepad or wordpad. The file should look something like this:-

// Standard extensions get all permissions by default

grant codeBase "file:${java.home}/lib/ext/*" {
permission java.security.AllPermission;
};

// default permissions granted to all domains

grant {
// Allows any thread to stop itself using the java.lang.Thread.stop()
// method that takes no argument.
// Note that this permission is granted by default only to remain
// backwards compatible.
// It is strongly recommended that you either remove this permission
// from this policy file or further restrict it to code sources
// that you specify, because Thread.stop() is potentially unsafe.
// See " for more information.

permission java.lang.RuntimePermission "stopThread";

// allows anyone to listen on un-privileged ports
permission java.net.SocketPermission "localhost:1024-", "listen";

// "standard" properies that can be read by anyone
...

Add in this line:-

// from this policy file or further restrict it to code sources
// that you specify, because Thread.stop() is potentially unsafe.
// See " for more information.

permission java.security.AllPermission; // add in this line

permission java.lang.RuntimePermission "stopThread";

This should work BUT it isn't recommended to do so.

Hope this helps,
Leon If you need additional help, you can email to me at zaoliang@hotmail.com I don't guaranty that I will be able to solve your problems but I will try my best :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top