# Re: Read from MS Access DB in JDK 1.1.2 applet

steven.j.blumfield (steven.j.blumfield@ac.com)
30 Jun 97 15:58:18

- Messages sorted by: [ date ][ thread ][ subject ][ author ]
- Next message: Mark Rose: "Java Security Q&A Not Accessible"
- Previous message: Lee Wheat: "hyperlink bug"
- Maybe in reply to: steven.j.blumfield: "Read from MS Access DB in JDK 1.1.2 applet"

    Message-Id: <9706302328.AA3676@notes2.compuserve.com>

    To: marianne mueller <mrm@Eng>

    From: "steven.j.blumfield" <steven.j.blumfield@ac.com>

    Date: 30 Jun 97 15:58:18

    Subject: Re: Read from MS Access DB in JDK 1.1.2 applet

Thanks for the response - I have included the fragment of code which attempts
to open a connection with the MS Access DB.
I identified the line which generates the error -
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"). First, I commented out all the
DB connection statements (including Class.forName) and recompiled and executed
the applet with "AppletViewer TestApp.html". It worked fine. I then only
uncommented the "Class.forName" line as shown below.

// load the jdbc-odbc driver
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
println("Connecting to jdbc:odbc:" + DSN+","+UID+","+ PWD);
// make the DB connection
// dbConnection = DriverManager.getConnection("jdbc:odbc:" + DSN, UID,
PWD);
// prepare the stocks statement for later use (SQLForm invocation)
// stocksStmt = dbConnection.prepareStatement
// ("Select * from Quotes Where Symbol LIKE ?");

After recompile and exec, I received the error "
Failed:sun.applet.AppletSecurityException:
checkpackageaccess" as described before. I must reiterate - the above code
works fine in a standalone java app with the same functionality.

ARE THERE ANY LIMITATIONS with regard to JDBC/ODBC access from an applet? I
would appreciate your response to this.

Steve
___________________________________________________________________________________________________________________________________________________________________________________________________________________

To: steven j. blumfield
cc: java-security @ web2.javasoft.com @ internet
From: mrm @ Eng.Sun.COM (Marianne Mueller) @ internet
Date: 06/27/97 09:11 AM
Subject: Re: Read from MS Access DB in JDK 1.1.2 applet
___________________________________________________________________________________________________________________________________________________________________________________________________________________
Hi,

The checkpackageaccess exception means that your code isn't being
allowed to access one of the Java packages. I can't tell from the
code fragment which access might lead to that problem. Changing the
acl.read list won't affect the checks that guard package access.

Try to narrow down which package access leads to the
checkpackageaccess exception, and take it from there.

thanks,
Marianne

- Next message: Mark Rose: "Java Security Q&A Not Accessible"
- Previous message: Lee Wheat: "hyperlink bug"
- Maybe in reply to: steven.j.blumfield: "Read from MS Access DB in JDK 1.1.2 applet"