Hi there: I'm developing some application with an odbc link. I'm still testing it on a stand-alone PC and everything runs fine. Once I change the regular class, for an applet I'm getting some errors, so that the programs fails. Here are some lines of code: try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); } catch(java.lang.ClassNotFoundException e) { System.err.print("ClassNotFoundException: " + e.getMessage()); System.exit(1); }
the line which includes forName("sun..."), is generating the error due to the argument enclosed in quotes, is prefixed by the path where i'm working on (the path where class file is located). I figured out going over the Java Console on my browser (IE). the error says: com.ms.security.SecurityExceptionEx [method] Java.io.IOException: bad path: <my_current_working_directory>\sun\jdbc\odbc\JdbcodbcDriver.class The thing is: why the program runs correctly as an application and fails as an applet? The program is running on the same box where the dsn and database are defined.
Thanx for any help you can offer. Rogelio
Roger
Mahesh Mamani
Ranch Hand
Joined: Jun 25, 2001
Posts: 110
posted
0
Hi, You cannot connect to DB directly from applets. There are security issues involved... You have to code a servlet to connect to the DB and call this from the applet Mahesh
bichu
Greenhorn
Joined: Mar 01, 2002
Posts: 1
posted
0
Hai , U cant directly connect db to applet.there is some problem with security.applets are highly secured. so try using servlets.