Solved

Database connectivity from Applets

Posted on 2001-06-23
5
201 Views
Last Modified: 2010-03-31
HI..

Can u help me for connecting to vaious DB's from my applet. Also please provide me a detailed info on signed applets.

thanx..

Jim
0
Comment
Question by:jimaricat072100
5 Comments
 
LVL 3

Expert Comment

by:rjackman
ID: 6222573
hi
as far as the applet goes it can only connecdt to the server from which it is downloaded
o if u want to connect to some other server then u have to sign the applet
applet signing pls refer following
http://www.ryerson.ca/~dgrimsha/courses/cps530/SigningScript.html

http://www.object-arts.com/Lib/EducationCentre4/htm/appletcodesigning.htm
0
 
LVL 6

Expert Comment

by:jpk041897
ID: 6223027
As rjackman states, applets are restricted by the browswers security sandbox to only allow HTTP access from the server they were downloaded. The port JDBC uses is also blocked.

This leaves you with a few alternatives:

1.- Create a signed applet, again as rjackman suggests, and request the user for authorization to access th DB.

2.- Encapsulate your JDBC calls inside an HTTP packet (HTTP Tunneling).

3.- Use RMI (which is not blocked by the browser) to write a wrapper over JDBC that will allow you to make calls to a remote RMI server. This server will then act as a Proxy between the applet and the DB.


Option 1 is perhaps the simplest, but you are forced to create two versions: one for Netscape and one for IE. Additionaly, you will have to purchase Level 2 digital signatures.

Option 2 is the most complex option, it implies writting proxies on both the client and server ends. On the plus side, its the most flexible option.

Option 3 is perhaps your best bet. Its quite simple to define and implement an interface that forwards your client side JDBC calls to an RMI server. RMI even has support for HTTP tunneling in case you have to go through firewalls.

If you don't mind using ODBC, you can download a free JDBC-ODBC driver that runs over RMI called RMI-JDBC from:

http://www.objectweb.org/RmiJdbc/

hope this helps.
0
 
LVL 92

Expert Comment

by:objects
ID: 6223038
Here'a PAQ discussing JDBC communication from an applet that you may find helpful:

http://experts-exchange.com/jsp/qManageQuestion.jsp?ta=java&qid=20134997
0
 
LVL 5

Expert Comment

by:vemul
ID: 7616636
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 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:
modulo earned 0 total points
ID: 7639918
PAQ'd and points removed

modulo

Community Support Moderator
Experts Exchange
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Oracle SQL syntax check  without executing 6 109
even odd program using while loop 3 74
java example issue 5 46
jmeter usage 4 38
An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This video teaches viewers about errors in exception handling.

730 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