• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 409
  • Last Modified:

Java applet to run in IE that uses Oracle database

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
smuniasamy
Asked:
smuniasamy
1 Solution
 
garg_ranjanCommented:
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
 
OviCommented:
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
 
dbaoraCommented:
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
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
smuniasamyAuthor Commented:
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
 
OviCommented:
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
 
smuniasamyAuthor Commented:
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
 
smuniasamyAuthor Commented:
Would someone tell me how to sign the applet. Signing applets would solve my problems accessing the drivers and stuff
0
 
OviCommented:
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
 
vemulCommented:
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
 
SpideyModCommented:
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now