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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Performance using sevlets and jsp database

Status
Not open for further replies.

197603

Programmer
Jun 4, 2002
1
IN
I want to know exact difference between servlets and jsp?.
Does it improves the performance when database connection code inclides in jsp page?
Which one is better choice.Including the Database connection using the Servlet or jsp.
 
A jsp is compiled into a servlet and then executed, so there's no technical difference.

But in practical terms, a jsp exists to generate a web page. A servlet does work on the server, but will usually pass control to a jsp to display something to the user.

As far as the database code goes, I personally like to keep it out of the jsps. In a three tier model, the jsps are the presentation layer and the servlets are the middle or business layer (with the database itself as the final layer). I put the database code in the middle layer, in the servlets.
 
While I would agree that servlets can be used to accomplish this, but a more robust architecture might be to utilize RMI, CORBA, or EJBs as the middle layer.

-gc "I don't look busy because I did it right the first time."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top