Well there are few suggestions that I can make to start your off
1.) Code to interfaces not implementations
2) Use Spring JDBC 3) Take a look at using Springs component scanning and stereo type annotations to make bean configuration much easier.
4) Close your result set and connection or see #2 and let spring handle that for you.
5) As far as naming conventions and package structure you are a little off of the current conventions. This is really a matter of personal choice as well but if you are interested you could have a read of this link (just ignore the web-app directory in your case)
But since I did not see any question that you actually asked in your post I am not quite sure what you are looking for from us.
i am new to spring, i got a requirement in that i have to get all Department Details(Dept_Name,Dept_Id) from DEPARTMENT table in hr SCHEMA FROM Oracle .
i started coding from DAO Layer,
in that i retrieved Data from DBS, and Stored in ARRAYLiST , by Using VOobject
but in spring we are not creating VOObject directly, i am injecting by using spring config file
BUT i am not able do that, i am getting same 270 record repeatedly,
Spring beans are by default singletons so you do not want these to be Spring beans unless you want the same instance everywhere. So the answer to your question is you would not want to. Also note that when you use the new operator on the DepartmentSearchVO you will not get the spring managed bean but rather new one up. Since you have made this an instance variable this object is the same for each instance of DepartmentSearchDAOImpl (of which there is only one since it is a singleton)
Delete this from DepartmentSearchDAOImpl
I suggest you use typing on your collections, as well as coding to the interface rather than the implementation.
so change it to something more like this
And change this in your main method
also I would also suggest not using _ in method names it is unconventional although allowed.
You would then also remove the VO from your bean definition
I hope that helps get you started and answers your question. Good luck.
Well it comes down to what I was talking about earlier. Spring beans are singletons (only one instance). Some sorts of objects don't make sense to be spring managed beans. Value/model objects and Data transfer objects usually fall into this category. These types of objects are typically simple POJO's that just hold the state of the object they represent. They typically don't hold references to services or repositories or things that would be Spring beans.
Now services and repositories and controllers are different these we only need one instance, and they are good candidates to be managed by Spring.