• Post Reply Bookmark Topic Watch Topic
  • New Topic

Beans

 
Jimi Rock
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I have an application that uses jsp to support a user interface in oreder to query a database. I dont know if it is better to use beans or servlet to do so.
can any one help? I would like to know if there are some good examples that may help. any web links will be appreciated.
Regards,
mac.
 
Joe McGuire
Ranch Hand
Posts: 293
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If it were my app, I wouldn't use the JSP to query the database. Keep JSPs at the presentation layer. I might use a JSP to create an instance of an EJB that would query the database. If it's just a query, then I would use a Session bean (or perhaps even a servlet). If there's any updating, adding, or deleting of the database, then I would use an Entity Bean (or in an even more perfect world, have the JSP call a Session Bean that creates an instance of an Entity Bean to update the database).
 
Roopa Bagur
Ranch Hand
Posts: 267
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jsp's are compiled into servlets any way so you should be ok. Use Jsp as the presentation layer & use javabeans to do all the work behind the scenes.
Originally posted by Jimi Rock:
Hi all,
I have an application that uses jsp to support a user interface in oreder to query a database. I dont know if it is better to use beans or servlet to do so.
can any one help? I would like to know if there are some good examples that may help. any web links will be appreciated.
Regards,
mac.

 
Marcos Maia
Ranch Hand
Posts: 977
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This kind of application it�s a tipicall client-server app, Java delivers to you a much moore powerfull(scallable, secure, reusable..) way to build server side applications with ejb�s and all that stuff and it�s easy because it�s still java, take a look at ejbs as Joe�s mentioned, you problably gonna like it. http://java.sun.com/j2ee/blueprints/index.html
http://java.sun.com/j2ee/blueprints/design_patterns/index.html

[This message has been edited by Marcos Maia (edited September 12, 2001).]
 
Jimi Rock
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
thanks a lot for all of ur replys...
Joe,
I prefer the solution u provided. it is exactly what I want. using jsp for presentation. jsp is supposed to call beans for quering the database.
can u please provide me with some examples... that would be great.
Thanks for all again.
Regards,
mac.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!