CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Jul 2001
    Location
    Malaysia
    Posts
    53

    Why applet can't access JDBC? UGENT pls!!!

    helo all,
    why i can't access to jdbc through applet? if i register the driver, the security exception comes out ? .. izzit something related to untrusted applet ? any one who help me will be rated, pls !! . it's urgent for me!! thanks you

  2. #2
    Join Date
    Jun 1999
    Location
    Eastern Florida
    Posts
    3,877
    You might be able to give the applet permission by using the policytool. Look at the error message for what permission to give. The applet will have to be executed in the java plugin for the permission to be effective; browsers don't use the java.policy file where the permission is recorded.
    Why not rewrite the program as an application to get around the security issue?
    Norm

  3. #3
    Join Date
    Jul 2001
    Location
    Malaysia
    Posts
    53
    i need to make it online for centralize my database, you mention some policy stuff ... i'm not quite understand that.. then how can i configure it to become accesible? THANKS YOU!! .. need your reply again

  4. #4
    Join Date
    Jun 1999
    Location
    Eastern Florida
    Posts
    3,877

    Applet permissions vs server database

    Is your database on the server that the applet is loaded from? Or on the client's computer? I was assuming the latter.
    I know a little about security settings for applets and how to give them permissions, but I know nothing about databases.
    Applets don't need permission to communicate to the server that they were loaded from.
    Perhaps you could explain your setup a little more.
    Norm

  5. #5
    Join Date
    Jul 2001
    Location
    Malaysia
    Posts
    53
    Norm,
    very thanks for your reply, i'm using Ms SQL as my database,
    i did read out some security policy about applet, and i knew that applet can't make call to native method,, then izzit means that
    when i invoke 'Class.forName("Mydrive")' it raise error? .. but how ever ... i can't even get through further, and i did read out JDBC security, it listed that untrusted applet cant open connection to database, izzit means that , it's no way of doing that? ... i think i will shift back to application .. thanks you anyway

  6. #6
    Join Date
    Jun 1999
    Location
    Eastern Florida
    Posts
    3,877
    What is the full text of the error message you are getting?

    What is the setup for your application and how are you running it? Is there a database server running on another machine? Is your applet being loaded from the same server or is it being loaded from a local HTML file? Where is the class file for the driver that you are trying to load with the Class.forname() method? Is it in the same jar file as the applet? Or on the local classpath? Or on the server?
    Norm

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured