• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Reagarding Access on databse and file system from applet in same code base

 
suman paul
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tried to access databse and file system from the same codebase thro' applet getting exception.
But form code base its not supposed to do right??
I used access and Jdbc dbc driver.Could you kindly give the code snippet relevant to that.
The applet class and its dependencies as well as
the DAO class all in the tomcat server root dir.
What i did.
Properties prop=new Properties();
prop.put("java.security.policy",new File("MyPolicy.policy"));
MyPolicy.policy
grant {
permission java.net.SocketPermission "developer",
"resolve";
"accessClassInPackage.sun.jdbc.odbc";
permission java.lang.RuntimePermission
"accessClassInPackage.sun.jdbc.odbc";
permission java.util.PropertyPermission
"file.encoding", "read";
};
It would read the files from "." dir current dir and make hir.
Now the exception
cannot access File.
kindly give these section code and policy file if reqd or alternative way to access file system as well as database.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic