I am getting
access denied (java.net.SocketPermission,10.01.1.72.1526,resolve)
Code follows
import java.sql.*;
import java.util.*;
import java.applet.*;
import java.awt.*;
public class TestDB extends
Applet {
private
String strPrint = "Teststring";
public void init()
{
try{
//DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
Class.forName("oracle.jdbc.driver.OracleDriver");
strPrint="Instantiated";
repaint();
String connurl = "jdbc

racle:thin:@10.10.1.72:1526:sysdb";
Connection conn = DriverManager.getConnection(connurl,"NetSkill","netskill01");
String strQuery = "Select count(*) from tab";
PreparedStatement pstmt = conn.prepareStatement(strQuery);
ResultSet rs = pstmt.executeQuery();
while(rs.next()){
strPrint = rs.getString(1);
}
}
catch(Exception exp){
strPrint ="Exception==>"+exp.getMessage();
}
}
public void paint(Graphics g){
g.drawString(strPrint,300,300);
}
public void getPermission(){
Properties prop = new Properties();
prop.put("java.security.policy", new File("MyPolicy.policy"));
}
}
Policy file
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";
};
could anyone help me in this scenario.I extracted classes12.zip and put it in the same codebase.And the Applet class file is in the sam codebase.After that only its recognising all classes but getting this exception.Though sun says
we don't need policy file as its loaded from codebase and accessing the server there.So what is the solution??
URGENT
