This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JDBC and the fly likes data access tier Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "data access tier" Watch "data access tier" New topic
Author

data access tier

Lidia Cyc
Greenhorn

Joined: Aug 05, 2003
Posts: 25
hey all,
2 design questions:
i develop a webapp trying to keep it mvc clean. so, there are business beans and data access classes responsible for those beans-to-database relations (loading, storing, etc).
1. i've seen that some folks make the methods of the data access classes static and some others don't. what is the better solution? does static in this case means thread safe?
2. there is a chance that in the code i'll need a number of those data access methods in a sequence. taking in account that i use a connection pooling, would you make those methods receive a Connection object from outside (this way a number of methods will be executed with the same connection, but i'll have to leave all connection.close() bla bla bla stuff
out of the method scope) or would you put all of the db connection logic inside the methods (this way i'll have to take a new connection from the pool for each method and method...) ?
and, if you are in the "let's help this guy" mood, take a look at this :
http://www.coderanch.com/t/358009/Servlets/java/architecure-dbcp
may be you'll give me a cool advice.
thanks
cL:.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60752
    
  65

"Cyc Lid",
Please take a look at the JavaRanch Naming Policy and change your display name to match it.
In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.
Thanks!
bear
JDBC Forum Bartender


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: data access tier
 
Similar Threads
To Nikhil Pendharkar for IBM 287
Networking : RMI
Please help me out with this
Re: Closing database connection in destroy metod()?
IBM 287 ICE TEST