Solved

Java applet to run in IE that uses Oracle database

Posted on 2001-07-23
10
396 Views
Last Modified: 2013-11-23
I am developing a system that has an applet with Oracle Environment. The requirement is to create an applet, that access the Oracle database from IE environment.

     I am successful creating an applet that gets the data from Oracle database. I am using the sun jdbc.odbc driver for this. I am able to run this applet pretty good from Appletviewer. I created the policy file to circumvent the security violation.

     When I am testing the applet from IE  browser, I am getting the jdbc.odbc driver object not found error. When I tried to use the thin driver, I got the access violation error when it is connecting to Oracle database.

     I am kinda of stuck at this point. Could u please give me some sample working code. I also would like to get any test certificate from you, if any , to run the test. If it is successful, then I can get the real certificate before the system goes live. Any help towards this is much appreciated.
0
Comment
Question by:smuniasamy
10 Comments
 

Expert Comment

by:garg_ranjan
ID: 6311302
u will have to use third party oracle jdbc drivers for this purpose , you can't use jdbc:odbc driver in applets.

you can get driver information from java.sun.com site
0
 
LVL 9

Expert Comment

by:Ovi
ID: 6311339
The applets are not allowed to access the client computer where they runs. Even if you run your applet in your computer, this is considered as a client machine so you cannot acces your jdbc:odbc data source. To solve the problem you have three different options :
1. Use an Java oracle database driver and load'it with your applet, they are for free at the oracle site
2. Comunication with an CGI hosted by the database server which will do the queries for you
3. Comunicate with an servlet.
0
 
LVL 2

Expert Comment

by:dbaora
ID: 6311523
Hi,
You need to include all used jars in your applet's HTML file.
in your applet's HTML file you should include the code
(note, the code refers to java version 1.2):

<!--"CONVERTED_APPLET"-->
<!-- CONVERTER VERSION 1.0 -->
<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
WIDTH = 120 HEIGHT = 20 NAME = "Loading..." ALT = "Can not run java applet , use a nevigator that support java."  codebase="Plugin/jre1_2_2-win.exe#Version=1,2,0,0">
<PARAM NAME = CODE VALUE = "algotec.medistore.admintool.AdminMain.class" >
<PARAM NAME = ARCHIVE VALUE = "yourfile.jar, sun_jdbc_file.jar, any_other_files.jar" >
<PARAM NAME = NAME VALUE = "Loading..." >

<PARAM NAME="type" VALUE="application/x-java-applet;version=1.2">
<COMMENT>
<EMBED type="application/x-java-applet;version=1.2" java_CODE =
"your_class.class" java_ARCHIVE =
"yourfile.jar, sun_jdbc_file.jar, any_other_files.jar" ALT = "Can not run java applet , use a nevigator that support java." NAME = "Loading..." WIDTH = 120 HEIGHT = 20   pluginspage="http://java.sun.com/products/plugin/1.2/plugin-install.html"><NOEMBED></COMMENT>

</NOEMBED></EMBED>
</OBJECT>
This will install the java plugin in case you don't have it installed and will be able to read all of the jars you used in your java file (all the imports).
regards,
dbaora.
0
 

Author Comment

by:smuniasamy
ID: 6314581
My question was how to connect the applet that uses Oracle database from the browser.

I was successful connecting the plain swing applet thru java plug-in though.

any help is much appreciated.

thanks
Samy
0
 
LVL 9

Expert Comment

by:Ovi
ID: 6316027
The applets are not allowed to access the client computer where they runs. Even if you run your applet
                     in your computer, this is considered as a client machine so you cannot acces your jdbc:odbc data source.
                     To solve the problem you have three different options :
                     1. Use an Java oracle database driver and load'it with your applet, they are for free at the oracle
                     site
                     2. Comunication with an CGI hosted by the database server which will do the queries for you
                     3. Comunicate with an servlet.
0
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 

Author Comment

by:smuniasamy
ID: 6317213
I tried oracel thin driver and i was not successful still. I would appreciate if someone give me working code that uses this type of driver in applet. Earliest reply is much appreciated
0
 

Author Comment

by:smuniasamy
ID: 6317549
Would someone tell me how to sign the applet. Signing applets would solve my problems accessing the drivers and stuff
0
 
LVL 9

Expert Comment

by:Ovi
ID: 6320768
You have in your jdk path in subdirectory docs\guide\security\index.html the documentation for the usage
                     of the jarsigner tool which can be foud in your bin directory (from the same path). If you are using
                     swing, for your browser must be also enbled the JavaPlug-in in order to run the applet.


                     Also, take a look at :


                     http://www.suitable.com/Doc_CodeSigning.shtml
                     http://developer.netscape.com/docs/manuals/signedobj/
                     http://home.istar.ca/~neutron/comparejar/
                     http://java.sun.com/docs/books/tutorial/jar/sign/
                     http://java.sun.com/products/plugin/1.2/docs/nsobjsigning.html
                     http://www.dinopolis.org/documentation/misc/theses/pzamb/node97.html
                     http://java.sun.com/security/signExample/
                     http://home-1.worldonline.nl/~bmc88/java/sbook/031.html
                     http://personal.vsnl.com/sureshms/javasign1.html
                     http://www.geocities.com/SiliconValley/Way/7050/java/signing.htm
                     http://www.securingjava.com/appdx-c/appdx-c-2.html
                     http://cad.ntu-kpi.kiev.ua/~netlib/ConfMater/InetSecure2000/WWW-sec/html/text59.htm
                     http://www.ryerson.ca/~dgrimsha/courses/cps530/jar.html
0
 
LVL 5

Expert Comment

by:vemul
ID: 7669519
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
- To be PAQ'ed and points NOT refunded
Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !

vemul
Cleanup Volunteer
0
 

Accepted Solution

by:
SpideyMod earned 0 total points
ID: 7714460
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now