Applet + MS访问 [英] Applet + MS Access

查看:178
本文介绍了Applet + MS访问的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我其他问题的更具体的版本。我创建了一个应用程序,应该与我的MS Access数据库通信。它工作正常,当我通过一个编译器运行它,但是当我嵌入.class文件在一个html页面和打开html页面,它运行,但它不应该对数据库实际发生的更改,它不能检索数据库中的数据。我最终要把这个html文件发布到一个安全的网络。小程序应该直接与计算机上的数据库通信,没有servlets / socket / etc(即使这是不好的做法)。如果不同的计算机访问html页面,它应该能够运行applet并且对主计算机上的数据库进行改变,但是它不需要允许applet对其自己的文件进行任何特殊访问,因为它们没有被改变,只有主机上的数据库是。所以我看到没有理由使它成为一个签名的小程序,因为这将使小程序来更改任何计算机,而不只是它自己的。我运行Vista所以策略工具不可用。

This is a more specific version of my other question. I have created an applet that should communicate with my MS Access database. It works fine when I run it through a compiler, but when I embed the .class file in an html page and open the html page, it runs but none of the changes it is supposed to make to the database actually happen and it cannot retrieve data from the database. I am eventually going to publish this html file to a secure network. The applet should communicate directly with the database on the computer, without servlets/sockets/etc (even though this is supposedly not good practice). If a different computer accesses the html page, it should be able to run the applet and make changes to the database on the host computer, but it need not allow the applet any special access to its own files, since they are not being changed, only the database on the host computer is. So I see no reason to make it a signed applet, because that will enable the applet to make changes to any computer, not just its own. I run Vista so policy tool is not available.

注意:html文件,类文件和java源文件都在我的计算机上的同一个文件夹,这是它会留下的方式。

Note: the html file, the class file, and the java source file are all on my computer in the same folder, and this is the way it will stay. The html file is not yet published, I just created it myself to test the applet.

推荐答案

我实际上尝试过这种类型的事前。我认为你的问题在于applet的性质。

I have actually attempted this sort of thing before. I think your problem lies in the nature of an applet.

Applet由客户端计算机下载并运行,因此如果您尝试访问的数据库存在于服务器上,则客户端可能无法访问数据库位置。而且我们都知道,来自客户端机器的代码不被信任。

Applets are downloaded and run by the client machine, so if the database that you are trying to access exists on the server, the client probably does not have access to the database location on the server. And as we all know, code from the client machine is not to be trusted.

将servlet重写为servlet可能更容易,因为servlet存在于服务器,并且可能具有对数据库的访问。然后,您的servlet可以发送html并在客户端和服务器之间来回接收表单数据。

It may be easier to rewrite your page as a servlet, as the servlet lives on the server and presumably has access to the database. Your servlet can then send html and receive form data back and forth between the client and server.

如果您的心设置在applet前端,则可以发送http消息回到一个servlet,然后servlet将执行数据库操作。

If your heart is set on an applet front end, you could send http messages back to a servlet which would then perform the database operations. This option would be far more secure and a lot easier to implement permission-wise.

希望这有帮助,如果您有其他问题,请告诉我。

Hope this helps, let me know if you have additional questions.

这篇关于Applet + MS访问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆