jimaricat072100
asked on
Database connectivity from Applets
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
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
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.
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.
Here'a PAQ discussing JDBC communication from an applet that you may find helpful:
https://www.experts-exchange.com/jsp/qManageQuestion.jsp?ta=java&qid=20134997
https://www.experts-exchange.com/jsp/qManageQuestion.jsp?ta=java&qid=20134997
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
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
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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