im trying to use the @Value for some of my strings in SpringBoot, when i set the @Value the string doesn’t get the data, i don’t know if i have to make a principal configuration or something that im forgetting (im new in springboot)
@Component public class BDController { @Value("${bbdd_ip}") private String bbdd_ip;
The error that i get:
Cannot invoke "java.sql.Connection.close()" because "c" is null
All the time that im trying to connect to my db i cant because i cant get the data, that i have it in the application.properties.
Mariano Fernández Rodero is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.