• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Opinion with db access

 
Davie Lin
Ranch Hand
Posts: 294
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone, I was wondering if it's better to have the jdbc code in the Controller or the Model? or does that even matter at all. Which is the standard practice amount you experienced programmers?

Thanks
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64832
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All DB access should be hidden behind the Model layer in my opinion.
 
pravin kantipudi
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
all jdbc code should be in a DAO.Data Access Object pattern.

Your controller class should invoke model class which inturn should invoke DAO class to do all jdbc calls

hope this explains. Look at DAO pattern for more info
 
Davie Lin
Ranch Hand
Posts: 294
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where can I find more DAO info? Can anyone of you provide me a link that I can do more research about it?


Thank you
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64832
86
IntelliJ IDE Java jQuery Mac Mac OS X
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic