Hi, all!
Igor notified me that there is a JCA/CAJ debate going on... :)
Note that applets are run in a "sanbox" and do not have the same permissions like any ordinary java application, simple reasion: you do not want an applet to delete your local files. Calls as IO/file calls are restricted, some system calls call and also making TCP/UDP connections to the other-than-originating server (from where applet was loaded) are not allowed, so this will not work for for JCA (I guess this is the problem here). Still there is a simple solution. You must sign the JAR file. Signed JARs (accepted by user) will gain more permissions.
Just a note:
catch(Exception ex) { System.err.println("Initialization failed for " + dpm.dataSource+":\n" + ex + "\n"); System.exit(1); }
Exception handling is one of the things that 99% of (java) programmers do not do right. Just to be short (not to write the whole essay): if you cannot handle the exception, stack it (and provide any context information) and rethrow, or at least (not really nice solution) dump the whole stack trace (this will show you the source of the problems). Still it is safer to catch Throwable than Exception. So add line "ex.printStackTrace()" after println.
Matej |