Java UCAExc:::4.0.1通过appletviewer实用程序在小程序代码中运行的拒绝访问异常

Java UCAExc:::4.0.1通过appletviewer实用程序在小程序代码中运行的拒绝访问异常,java,applet,ucanaccess,Java,Applet,Ucanaccess,我正在使用UCANCESS 4.0.1 在此之前,我通过Java程序在表中插入数据来检查连接,但当我在applet中添加代码时,连接不起作用。 我使用以下命令来运行applet public class SetupExam extends Applet { /** * */ private static final long serialVersionUID = -4106575420788590877L; private JTextField td

我正在使用UCANCESS 4.0.1

在此之前,我通过Java程序在表中插入数据来检查连接,但当我在applet中添加代码时,连接不起作用。 我使用以下命令来运行applet

public class SetupExam extends Applet {
    /**
     * 
     */
    private static final long serialVersionUID = -4106575420788590877L;
    private JTextField td_tf;
    private JTextField mfeq_tf;
    private JTextField nmfe_tf;

    /**
     * Create the applet.
     */
    public SetupExam() {
        setLayout(null);
        JLabel main_l = new JLabel("Exam");
        main_l.setHorizontalAlignment(SwingConstants.CENTER);
        main_l.setFont(new Font("Arial", Font.BOLD, 15));
        main_l.setBounds(7, 4, 601, 42);
        add(main_l);

        JLabel cat_l = new JLabel("1.Category");
        cat_l.setFont(new Font("Arial", Font.PLAIN, 15));
        cat_l.setBounds(16, 80, 162, 32);
        add(cat_l);

        JLabel td_l = new JLabel("2.Time Duration");
        td_l.setFont(new Font("Arial", Font.PLAIN, 15));
        td_l.setBounds(16, 130, 162, 32);
        add(td_l);

        JLabel noq_l = new JLabel("3.Number of Questions");
        noq_l.setFont(new Font("Arial", Font.PLAIN, 15));
        noq_l.setBounds(13, 184, 165, 32);
        add(noq_l);

        JLabel mfeq_l = new JLabel("4.Marks for each Question");
        mfeq_l.setFont(new Font("Arial", Font.PLAIN, 15));
        mfeq_l.setBounds(13, 236, 178, 32);
        add(mfeq_l);

        JLabel nmfe_l = new JLabel("5.Negtive Mark For Each");
        nmfe_l.setFont(new Font("Arial", Font.PLAIN, 15));
        nmfe_l.setBounds(13, 293, 178, 32);
        add(nmfe_l);

        JComboBox cat_combo = new JComboBox();
        cat_combo.setEditable(true);
        cat_combo.setBounds(237, 80, 208, 32);
        add(cat_combo);

        td_tf = new JTextField();
        td_tf.setBounds(237, 130, 208, 32);
        add(td_tf);
        td_tf.setColumns(10);

        mfeq_tf = new JTextField();
        mfeq_tf.setColumns(10);
        mfeq_tf.setBounds(237, 236, 208, 32);
        add(mfeq_tf);

        nmfe_tf = new JTextField();
        nmfe_tf.setColumns(10);
        nmfe_tf.setBounds(237, 293, 208, 32);
        add(nmfe_tf);


        JSpinner noq_spin = new JSpinner();
        noq_spin.setModel(new SpinnerNumberModel(10, 1, 100, 1));
        noq_spin.setBounds(237, 180, 208, 32);
        add(noq_spin);



        JButton sbmt_btn = new JButton(mfun());
        sbmt_btn.setFont(new Font("Arial", Font.PLAIN, 12));
        sbmt_btn.setBounds(228, 383, 126, 41);
        add(sbmt_btn);

    }
    public String mfun()
    {
        try
        {
         Class.forName("net.ucanaccess.jdbc.UcanaccessDriver");
        Connection con=DriverManager.getConnection("jdbc:ucanaccess://C:\\workspace\\exam.mdb");
        Statement st = con.createStatement();
        ResultSet rs = st.executeQuery("Select * from  exam_setup");
        while (rs.next())
            {
                //System.out.println(rs.getString(3));
                return rs.getString(3);

            }
         } catch (Exception ex)
                   {
                System.err.print("Exception: ");
                System.err.println(ex.getMessage());
                   }
        return null;


    }

}
输出:

异常:UCAExc:::4.0.1访问被拒绝(“java.util.logging.LoggingPermission”“control”)


appletviewer
实用程序显然是在受限环境中运行applet代码的,很可能类似于用于应用程序的“沙盒”。UCanAccess不是为在这样的环境中运行而设计的

appletviewer ExamSystem.html