Solved

Java applet to run in IE that uses Oracle database

Posted on 2001-07-23
10
398 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

943 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

4 Experts available now in Live!

Get 1:1 Help Now