• Post Reply Bookmark Topic Watch Topic
  • New Topic

Accessing Database

 
chikki singh chotala
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it better to access database using servlet or java Beans? If so why......
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Niether. You use some sort of Data Access Object or even a POJO, helper class... Call it what you want. This class should be called from your servlet to populate your bean.
 
chikki singh chotala
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it not possible to access database with servlet directly ....we can use JDBC for accessing the database...
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by chikki singh chotala:
Is it not possible to access database with servlet directly ....we can use JDBC for accessing the database...


Is this a question or a statement? You can access a database using JDBC directly from a servlet. It's just not the preferred method. Servlets are controllers.
[ October 05, 2004: Message edited by: Gregg Bolinger ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!