Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Help on JDBC

4 views
Skip to first unread message

Marco H. Raposo

unread,
Feb 19, 1999, 3:00:00 AM2/19/99
to
I'm building an applet that tryies to connect to a DB using JDBC.
when executing the following line of code

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

i receive the following error:

java.security.AccessControlException: access denied
(java.lang.RuntimePermission
accessClassInPackage.sun.jdbc.odbc )
at java.security.AccessControlContext.checkPermission(Compiled
Code)
at java.security.AccessController.checkPermission(Compiled Code)

at java.lang.SecurityManager.checkPermission(Compiled Code)
at java.lang.SecurityManager.checkPackageAccess(Compiled Code)
at sun.applet.AppletSecurity.checkPackageAccess(Compiled Code)
at
sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:107)
at java.lang.ClassLoader.loadClass(Compiled Code)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Compiled Code)
at Query.init(Query.java:31)
at sun.applet.AppletPanel.run(Compiled Code)
at java.lang.Thread.run(Thread.java:479)

can anyone help me?
i'm new on JAVA programing.

Thanx in advance


mhraposo.vcf

Keith

unread,
Feb 19, 1999, 3:00:00 AM2/19/99
to Marco H. Raposo
If you are trying to access a database that is not on the server
that the web server lives on, your client applet will not be able to access
that database server due to the default security placed on applets. (That is
that they can only talk back to the server they came from) I do believe
that there is a way to get around by having the applet "request" privileges
from the server, but I am not sure of the details to make it happen.

Is there a reason that you are using a client applet as opposed to
using plain html? You can write server side "applets" ( in some circles a
"servlet") that are not limited by the security restrictions and present the
results with html. ( I have even have experience using a client applet that
makes requests to a server applet that in turn access the database and
returns the results to the client applet) I use the server side applet with
an html front end and have found it much easier than writing applets just
for the purpose of displaying data. It also gives you the advantage of a
wider "viewing" audience because you eliminate the "problems" with different
versions of browsers not being able to run the applet.

Anyhow, hope this helps you out.

Keith
--
:^):^(:^):^(:^):^(:^):^(:^):^(:^):^(:^):^(:^)
Keith Popendieker
pac...@pitt.edu || http://www.pitt.edu/~kapst4 || 412.648.7782

The biggest obstacle to progress is not ignorance
but the illusion of knowledge. -- Daniel Boorstin

Technology is dominated by two types of people; those who understand
what they do not manage, and those who manage what they do not understand.

Marco H. Raposo wrote:

> ------------------------------------------------------------
>
> Marco Henrique de Caravalho e Melo Raposo <mhra...@ccg.uc.pt>
>
> Marco Henrique de Caravalho e Melo Raposo
> <mhra...@ccg.uc.pt>
> HTML Mail
> Cellular: 0936 2437702
> http://alumni.dee.uc.pt/~mhraposo
> Additional Information:
> Last Name Raposo
> First NameMarco Henrique de Caravalho e Melo
> Version 2.1

0 new messages