What should we do if we want to create a method called getConnection() within this class and use that connection object in various daos to perform crud operations.. In such a case which is better option to make the whole class final only the getConnection method synchronized???
In a case where I have a method called getConnection() for it should be called to perform crud operation in daos, which option would be better - to make the class as final or to make the method synchronized.. Also I have placed a method for closing the resources in this class itself.. as close(rs,st,con)..
Simply described...:-)
ReplyDeleteThanks...:)
ReplyDeleteClear explanation.. Easily understandable...Thanks
ReplyDeleteWhat should we do if we want to create a method called getConnection() within this class and use that connection object in various daos to perform crud operations.. In such a case which is better option to make the whole class final only the getConnection method synchronized???
DeleteIn a case where I have a method called getConnection() for it should be called to perform crud operation in daos, which option would be better - to make the class as final or to make the method synchronized.. Also I have placed a method for closing the resources in this class itself.. as close(rs,st,con)..
Deleteit seems okay.
DeleteYou have mentioned "I have shared a small eclipse project here...".. But it shows empty folder in google dirve.. pls check to it..
ReplyDeletePlease check the link again.
DeleteAgain the page shows:
DeleteGoogle logo Drive Sign in
JdbcSingleTone Empty folder
try this https://drive.google.com/file/d/0B-OmBwkwiTCQUkQ0dER2c0xjUXM/edit?usp=sharing
DeleteThanks for your reply..
Delete