Spring performs two major roles for a Java application.
First Spring is a container that manages all or some of the objects used by the application. Behind the scenes Spring configures your objects with what they need to in order to perform their roles in the application. If you need a Data Access Object, you ask the Spring container to provide one that is already configured with values for its data source and other properties.
Spring is also a framework because it provides libraries of classes that make it easier to accomplish common tasks such as transaction management, database integration, email, and web applications.