avatar
c*a
1
我的一个JApplet再JCreator中运行非常正常,没有任何异常。
但是把该JApplet加入一个html文件
运行该html文件
再java控制台有如下错误提示:
java.sq.SQLException:unable to connect to any hosts due to exception:
java.security.AccessControlException:access denied(java.util.Property
Permission file.encoding read)
at com.mysql.jdbc.Connection.createNewIO(Connection.java:1797)
at com.mysql.jdbc.Connection.(Connection.java:562)
at com.mysql.jdbc.Connection.NonRegisteringDriver.connect(NonRegisteringDriv
er.java:361)
at java.sql.DriverManager.getConne
avatar
r*l
2
It's a security exception. The security manager on your machine does not allow
the Applet to access local IO. The end result is Applet will not make JDBC
connection.
Normally, no one tries to use Applet to insert data into database through JDBC
directly. It's not a good practice.

【在 c***a 的大作中提到】
: 我的一个JApplet再JCreator中运行非常正常,没有任何异常。
: 但是把该JApplet加入一个html文件
: 运行该html文件
: 再java控制台有如下错误提示:
: java.sq.SQLException:unable to connect to any hosts due to exception:
: java.security.AccessControlException:access denied(java.util.Property
: Permission file.encoding read)
: at com.mysql.jdbc.Connection.createNewIO(Connection.java:1797)
: at com.mysql.jdbc.Connection.(Connection.java:562)
: at com.mysql.jdbc.Connection.NonRegisteringDriver.connect(NonRegisteringDriv

avatar
c*a
3
fist of all, I really appreciated your reply.
Actually, I didn't do any insertion about the data to the database.
just some retrieval.
Can you give me some hints about how can I realize it?
Thank you.

It's a security exception. The security manager on your machine does not allow
the Applet to access local IO. The end result is Applet will not make JDBC
connection.
Normally, no one tries to use Applet to insert data into database through JDBC
directly. It's not a good practice.

【在 r***l 的大作中提到】
: It's a security exception. The security manager on your machine does not allow
: the Applet to access local IO. The end result is Applet will not make JDBC
: connection.
: Normally, no one tries to use Applet to insert data into database through JDBC
: directly. It's not a good practice.

avatar
d*p
4
If you want to access local database, write
a norml Java application. Otherwise, use some
server side techonology like Servlet, JSP to
retrieve the data and generate the result
html page at the server side.

【在 c***a 的大作中提到】
: fist of all, I really appreciated your reply.
: Actually, I didn't do any insertion about the data to the database.
: just some retrieval.
: Can you give me some hints about how can I realize it?
: Thank you.
:
: It's a security exception. The security manager on your machine does not allow
: the Applet to access local IO. The end result is Applet will not make JDBC
: connection.
: Normally, no one tries to use Applet to insert data into database through JDBC

avatar
c*a
5
Yes, just like what you had said. I want to be as a server to enable somebod
y else to visit me..
What kind of tech. I can use to achieve that?
JSP,Servlet.or JavaBean?
All transactions all happen to the applet, nothing to deal with the html files.

【在 d******p 的大作中提到】
: If you want to access local database, write
: a norml Java application. Otherwise, use some
: server side techonology like Servlet, JSP to
: retrieve the data and generate the result
: html page at the server side.

avatar
r*l
6
Before you implement anything, you have to make sure the requirements and then
pick the right technology.
It's a long story and I will try to make it short here. For presentation,
there are different technologies for you to use:
1. Java Swing Application
Good for internal use (intranet). You can access database and other resource
easily. WebStart can make it easier to manage and distribute.
2. Applet
Code is downloaded through the internet. It's running inside the java enabled
browser. The secur

【在 c***a 的大作中提到】
: Yes, just like what you had said. I want to be as a server to enable somebod
: y else to visit me..
: What kind of tech. I can use to achieve that?
: JSP,Servlet.or JavaBean?
: All transactions all happen to the applet, nothing to deal with the html files.

avatar
c*a
7
Thank you very much.
Because I had no data interaction with the webpage. I decide to use applet t
echnology to solve this.
Futhermore. I had built my quite complex GUI. I think it's hard to put all
that in a html file.
Now a problem came to me. I need to build something called javakey. It's
some kind of security machnism that enable my applet on the client side to
access the database on the server side?
Is it true?
kind regards.

【在 r***l 的大作中提到】
: Before you implement anything, you have to make sure the requirements and then
: pick the right technology.
: It's a long story and I will try to make it short here. For presentation,
: there are different technologies for you to use:
: 1. Java Swing Application
: Good for internal use (intranet). You can access database and other resource
: easily. WebStart can make it easier to manage and distribute.
: 2. Applet
: Code is downloaded through the internet. It's running inside the java enabled
: browser. The secur

avatar
r*l
8
Again, it is a bad bad practice to try to allow Applet access the database on
the serverside.
Applet is downloadable through the internet and it is intended to be runing
inside user's network. Applet author can not control his user's firewall and
network setting.
Why you need to use Applet? If the user is on the internet, then JSP/Servlet
is the way to go. If all the users are on the local intranet, Java Swing
application should be used.
If you really really want to use Applet for whatever reaso

【在 c***a 的大作中提到】
: Thank you very much.
: Because I had no data interaction with the webpage. I decide to use applet t
: echnology to solve this.
: Futhermore. I had built my quite complex GUI. I think it's hard to put all
: that in a html file.
: Now a problem came to me. I need to build something called javakey. It's
: some kind of security machnism that enable my applet on the client side to
: access the database on the server side?
: Is it true?
: kind regards.

avatar
r*l
9
Actually, there's another option. You can sign your applet. A digitally signed
applet is treated like local code. It might require you to get a certificate
from CA. Otherwise, even you sign your applet, no one will trust your
signature and your code.

on
to
machine.
u
t
and
presentation,

【在 r***l 的大作中提到】
: Again, it is a bad bad practice to try to allow Applet access the database on
: the serverside.
: Applet is downloadable through the internet and it is intended to be runing
: inside user's network. Applet author can not control his user's firewall and
: network setting.
: Why you need to use Applet? If the user is on the internet, then JSP/Servlet
: is the way to go. If all the users are on the local intranet, Java Swing
: application should be used.
: If you really really want to use Applet for whatever reaso

avatar
c*a
10
yes, that's the javakey what i had referred to.
I'll first use a certificate signture to solve it.
Because the java application is available, I don't need to do
a lot of modification to achieve that.
If time is available, I'll learn and try some other tech. like
JSP.
Thanks anyway. Rekal.

【在 r***l 的大作中提到】
: Actually, there's another option. You can sign your applet. A digitally signed
: applet is treated like local code. It might require you to get a certificate
: from CA. Otherwise, even you sign your applet, no one will trust your
: signature and your code.
:
: on
: to
: machine.
: u
: t

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。