Sagar Rohankar wrote:May be Serlvet context listener helps:
http://download.oracle.com/javaee/6/api/javax/servlet/ServletContextListener.html
Sorry Sagar. How do you even know if they have a web application?
For a Spring application, and for some simple task like what is needed here, a ContextListener is way overkill.
So an init-method is just a method that runs right after an object gets instantiated and all its dependencies and properties have been set.
SomeClass will be instantiated by Spring, the dataSource dependency will be injected, any properties will be set, then the someMethod method will be called.
That is how init-method works.
Mark