Java与数据库操作
使用jdbc-odbc桥接数据库,使用sql sever200
在java application中可以使用,
但是嵌到网页中,改成applet就不可以了;为什么?
哪位高手说一下?是不是我要用serlvet来替代applet?
从数据库中取值显示在网页上,但是不用asp,jsp
该怎么做?
问题点数:20、回复次数:7Top
1 楼asklxf(xuefeng)回复于 2003-11-01 09:15:21 得分 20
先得搞清楚:
applet是运行在客户端,servlet,jsp运行在服务器端。
运行在服务器端什么事都可以做,
但是在客户端的applet严格禁止任何读写本地文件的操作,当然不能访问本地数据库了。
applet能不能访问网络视安全设置而定。
应当用servlet, jsp访问数据库,仅仅把结果返回客户端Top
2 楼danceflying2003(枫之舞)回复于 2003-11-01 09:57:38 得分 0
搂主的问题,好像是无解的。不用asp,jsp(servlet和jsp本质上是一样的),还能有什么做法呢??Top
3 楼wanghehai(明月浪子)回复于 2003-11-01 10:56:08 得分 0
我觉得applet能够访问她的来源处的数据库,不是让她访问本的数据库的。
但是我还是担心applet能不能访问数据库。我是菜鸟,有问题多多指教Top
4 楼hotness28(小左)回复于 2003-11-01 15:50:40 得分 0
applet是可以访问数据库的,今天看到了一个帖子
大家请看:
http://www.csdn.net/develop/Read_Article.asp?Id=15810Top
5 楼hotness28(小左)回复于 2003-11-01 15:53:33 得分 0
我想applet来解决数据库问题不是很好的办法
也看到了一些书籍,上面说一般不用applet
而使用jsp+servler+javabean+ejb
但是这样还要配置jsp,大家是怎样调试程序的?Top
6 楼hotness28(小左)回复于 2003-11-02 07:32:48 得分 0
Can the JDBC-ODBC Bridge be used with applets?
Use of the JDBC-ODBC bridge from an untrusted applet running in a browser, such as Netscape Navigator, isn't allowed. The JDBC-ODBC bridge doesn't allow untrusted code to call it for security reasons. This is good because it means that an untrusted applet that is downloaded by the browser can't circumvent Java security by calling ODBC. Remember that ODBC is native code, so once ODBC is called the Java programming language can't guarantee that a security violation won't occur. On the other hand, Pure Java JDBC drivers work well with applets. They are fully downloadable and do not require any client-side configuration.
Finally, we would like to note that it is possible to use the JDBC-ODBC bridge with applets that will be run in appletviewer since appletviewer assumes that applets are trusted. In general, it is dangerous to turn applet security off, but it may be appropriate in certain controlled situations, such as for applets that will only be used in a secure intranet environment. Remember to exercise caution if you choose this option, and use an all-Java JDBC driver whenever possible to avoid security problems.
Top
7 楼minghui000(沉迷网络游戏)回复于 2003-11-03 00:23:24 得分 0
upTop




