• Post Reply Bookmark Topic Watch Topic
  • New Topic

use beans  RSS feed

 
vivek makode
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am using <jsp:useBean> action to connect to the database.
is it ok?
what is the best or professional or an efficient way for connecting to the database while developing any web application using JSP, EJB etc?
please reply asap.
thanks in advance
vivek
 
Sam Dalton
Author
Ranch Hand
Posts: 170
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would suggest not connecting to the database directly from the JSP. It would be better to either use a servlet to do the database work, or even better use and EJB (Entity (or session with JDBC)) to do it....
Rgds
Sam
 
S Chandra Mohan
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi vivek,
Upto my knowledge beans and JSP go well together.
U can create a bean which connects to the
database and return the connection.
I have done done 3 projects with the same idea.
This is my suggestion.
regards
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my opinion, one of the great things about using beans for this is you can test them separately from the servlet/jsp environment. Debugging a bean through a JSP is a real pain.
Bill
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!