• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Beans

 
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 293
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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).
 
Ranch Hand
Posts: 267
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.


 
Ranch Hand
Posts: 977
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
permaculture is a more symbiotic relationship with nature so I can be even lazier. Read tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic