Frameworks

Multiple Bean Selection

When several beans implement the same interface, Spring cannot decide which one to inject and fails with a “NoUniqueBeanDefinitionException”. You resolve it with @Primary (the default choice), @Qualifier(“beanName”) (an explicit choice), or by injecting all the beans as a Map or List. It is used when one feature has several implementations, such as Email and […]

Multiple Bean Selection Read More »

Component Scanning

Component scanning is how Spring automatically discovers classes annotated with @Component (and its specializations) and registers them as beans, with no XML or manual @Bean needed. @SpringBootApplication includes @ComponentScan, which scans the package of the main class and all its sub-packages. It is used so you can just annotate a class and have it become

Component Scanning Read More »

Dependency Injection

Dependency Injection (DI) means a class does not create the objects it needs; Spring creates them and hands them in. Spring looks at the constructor, setter, or field, finds a matching bean in the container, and injects it automatically. It is used for loose coupling, easy swapping of implementations (for example Email vs SMS), and

Dependency Injection Read More »

Spring Beans and Dependency Injection

DatabaseMetaData is a JDBC interface used to obtain information about the database, JDBC driver, tables, columns, and supported database features. It is obtained from a Connection object using the getMetaData() method. Using DatabaseMetaData, a Java program can dynamically inspect database information without directly querying system tables. This is useful for database administration, debugging, database migration

Spring Beans and Dependency Injection Read More »

Environment Profiles

Environment profiles let one application keep separate configurations for development, testing and production. Each profile has its own file, such as application-dev.properties and application-prod.properties. A property named spring.profiles.active decides which profile is loaded at startup. Settings that appear in both the common file and the profile file are overridden by the profile file. The same

Environment Profiles Read More »

Custom Configuration

Custom configuration means defining your own application-specific values (like college name or academic year) in application.properties instead of hard-coding them in Java. Spring Boot reads these values at startup and makes them available inside your classes. You can bind them to a Java class with @ConfigurationProperties, or read single values with @Value. Changing a value

Custom Configuration Read More »

YAML Configuration

YAML (application.yml) is a human-readable file for storing Spring Boot application settings in a hierarchical, indentation-based structure. Related settings such as server, database, and JPA are grouped under one parent key, so you don’t repeat prefixes. It supports maps, lists, and nested objects, and can hold separate settings for dev, test, and prod. The Student

YAML Configuration Read More »

Application Properties

application.properties is Spring Boot’s main external configuration file, located in src/main/resources. It holds settings such as the application name, server port, context path, database details, and your own custom values. It is used so behavior can change without touching Java code or recompiling. Values are read in code with @Value for a single property or

Application Properties Read More »

Spring Boot Configuration

DatabaseMetaData is a JDBC interface used to obtain information about the database, JDBC driver, tables, columns, and supported database features. It is obtained from a Connection object using the getMetaData() method. Using DatabaseMetaData, a Java program can dynamically inspect database information without directly querying system tables. This is useful for database administration, debugging, database migration

Spring Boot Configuration Read More »

Scroll to Top