java.security.AccessControlException

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kusuma chalasani
    New Member
    • Jan 2007
    • 19

    #1

    java.security.AccessControlException

    hi..
    i'm using msaccess database to retrive the data into an applet...
    during runtime i'm getting an error like
    java.security.A ccessControlExc eption:access denied(java.lan g .RuntimePermiss ionaccessClassI nPackage.sun.jd bc.odbc.)

    when i'm using the same code using main method it is working properly..
    for applet only it is showing this error..
    can u please help me in tracing this...
  • viijay
    New Member
    • Jan 2007
    • 2

    #2
    Originally posted by kusuma chalasani
    hi..
    i'm using msaccess database to retrive the data into an applet...
    during runtime i'm getting an error like
    java.security.A ccessControlExc eption:access denied(java.lan g .RuntimePermiss ionaccessClassI nPackage.sun.jd bc.odbc.)

    when i'm using the same code using main method it is working properly..
    for applet only it is showing this error..
    can u please help me in tracing this...
    Try to put your code in paint method

    public void paint(Graphics g) {
    <your code>
    }

    Comment

    • r035198x
      MVP
      • Sep 2006
      • 13225

      #3
      Originally posted by kusuma chalasani
      hi..
      i'm using msaccess database to retrive the data into an applet...
      during runtime i'm getting an error like
      java.security.A ccessControlExc eption:access denied(java.lan g .RuntimePermiss ionaccessClassI nPackage.sun.jd bc.odbc.)

      when i'm using the same code using main method it is working properly..
      for applet only it is showing this error..
      can u please help me in tracing this...
      Hi there. Your applet may to be signed for this to work but this is not usually neccessary when the applet is loaded locally. Are you using appletviewer or the browser for loading the applet?

      Comment

      • kusuma chalasani
        New Member
        • Jan 2007
        • 19

        #4
        i'm using appletviewer

        Comment

        • r035198x
          MVP
          • Sep 2006
          • 13225

          #5
          Originally posted by kusuma chalasani
          i'm using appletviewer
          Looks like you need to sign it





          Comment

          • kusuma chalasani
            New Member
            • Jan 2007
            • 19

            #6
            cant i have another solution instead of signing an applet?
            Even if i write the code in paint method, i'm getting the same exception..

            Comment

            • r035198x
              MVP
              • Sep 2006
              • 13225

              #7
              Originally posted by kusuma chalasani
              cant i have another solution instead of signing an applet?
              Even if i write the code in paint method, i'm getting the same exception..
              Writing the code in the paint method won't help. You have to sign it or play around with policy files.
              Applets are loaded onto browsers and so giving them access to the files on computers they are running on can pose a security risk. Have a look at all the links I gave you and try to understand what they are talking about.

              Comment

              Working...