Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Applets and Databases

Status
Not open for further replies.

nerram

Programmer
Apr 23, 2003
56
IE
I read somewhere that and applet can only make a connection with a the server that issues it. Does this mean it can only connect to a database on the servers machine or does it mean it cannot connect to a database at all. Any help clearing up the whole world or applets+databases+servers would be very helpful.
 
Server code, i.e., JSP, Servlets, classes executing in the server context, can connect to databases on other servers within your network.

-pete
I just can't seem to get back my IntelliSense
 
How does this apply to Applets? --Sorry I am completely useless with applets. and Is JSP only allowed to connect to databases on its servers network?
 
Well normally, for security purposes, you don’t want your database exposed outside your firewall which of course stops at your network boundary. I have no idea if you can circumvent this since I have no interest in doing so, but even if you can, I strongly advise against it.

-pete
I just can't seem to get back my IntelliSense
 
Best thing to do is run a servlet or other background process on the client and have the applet send its database requests to that.
The serverside process should then pack the results of the database action in some way and send it back over the network.

That way you can also build in authentication without having the database usernames and passwords transmitted to remote machines over the internet.
The serverside process could easily keep track of which client sessions are open and allow only communication with your applet if it is talking from a machine that has indeed loaded it from your server.
 
To clarify what jwenting was saying:

Basically use something like jsp, asp, php or coldfusion to communicate between your applet and your database. For example I use several coldfusion pages, located on the server, where the applet is located to communicate to my db. This way it doesn't matter if I'm using Oracle, SQL Server, or mySQL as my db. I simple send url requests via my applet to the correct coldfusion page, to upload info to my db or to retrieve info from my db.

Jason
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top