Solved

Database connectivity from Applets

Posted on 2001-06-23
5
197 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
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…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
The viewer will learn how to implement Singleton Design Pattern in Java.

776 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