Solved

Java applet to run in IE that uses Oracle database

Posted on 2001-07-23
10
399 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
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 

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
 

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

808 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