Why is servlet better

I

Ike

I have an applet which communicates with a MySQL database on a server the
served up the applet, communicating via JDBC.

Can someone please tell me why I want to use a servlet as an intermediary
between the database and the applet?

Thanks, Ike
 
M

Marko Lahma

Can someone please tell me why I want to use a servlet as an intermediary
between the database and the applet?

I think one point is the matter of abstraction. You can abstract away
the location of the database and even the structure if you exhange POJOs.

Servlet is usually necessity when the database server is not located on
the web server (you could of course sign the applet). Another thing to
consider is the security. The applet might leak the login credentials of
the db server.

-Marko
 
N

nielinjie

if you connect the database in your applet, somebody can decode the applet
and get your database's location and password.
 
I

Ike

Why would I ever have that hardcoded in my applet? Why would I not have a
signon dialog in my applet to ask the user for these things?
 
W

William Brogden

Ike said:
I have an applet which communicates with a MySQL database on a server the
served up the applet, communicating via JDBC.

Can someone please tell me why I want to use a servlet as an intermediary
between the database and the applet?

Faster response by virtue of connection pooling.
Better control over multiple "simultaneous" requests.
Better logging

WBB
 
T

Tor Iver Wilhelmsen

Ike said:
Can someone please tell me why I want to use a servlet as an intermediary
between the database and the applet?

1) If the servlet runs on the same host as the applet loads from the
applet does not have to be signed if the database is on a different
server.

2) Security: You gain control over what accesses your database.
Exposing a database to anyone who loads the applet is bad.
 
A

Andrew

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ike wrote:
| Why would I ever have that hardcoded in my applet? Why would I not have a
| signon dialog in my applet to ask the user for these things?
|
| |
|>if you connect the database in your applet, somebody can decode the applet
|>and get your database's location and password.
|>
|>"Ike" <[email protected]> дÈëÏûÏ¢ÐÂÎÅ
|>:[email protected]...
|>
|>>I have an applet which communicates with a MySQL database on a server
|
| the
|
|>>served up the applet, communicating via JDBC.
|>>
|>>Can someone please tell me why I want to use a servlet as an
|
| intermediary
|
|>>between the database and the applet?
|>>
|>>Thanks, Ike
|>>
|>>
|>
|>
|
|


To find out the reason you would use a servlet, you should research the
MVC (Model View Controller) pattern. It explains why you would use a
servlet as you asked.

- --
[A n d r e w]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQE/gC+0x4nopx2ZsVURAt8EAKCHokqazAS5yLiLeHFQQScP9eL9hwCgkSyo
uV4zcdSEu5DP2fy9fcW474k=
=cLBo
-----END PGP SIGNATURE-----
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,794
Messages
2,569,641
Members
45,355
Latest member
SJLChristi

Latest Threads

Top