Answer the question
In order to leave comments, you need to log in
How to fix dataSource/jdbcTemplate error on Spring boot?
When starting the app, it throws an error, although everything is specified in config.xml
I already spent a whole day on this, but I can’t understand why it doesn’t pull them
Crashes on the run () method
@SpringBootApplication
public class DeliverySpringApplication {
public static void main(String[] args) {
SpringApplication.run(DeliverySpringApplication.class, args);
}
}
<?xml version="1.0" encoding="UTF-8"?>
<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="org.postgresql.Driver"/>
<property name="url" value="jdbc:postgresql://test-db.host:5432/test"/>
<property name="username" value="user"/>
<property name="password" value="JKN7sa84gsufi"/>
</bean>
<bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
<property name="dataSource" ref="dataSource"></property>
</bean>
<bean id="daoImpl" class="com.delivery_spring.delivery.dao.promo.PromoDaoImpl">
<property name="jdbcTemplate" ref="jdbcTemplate"></property>
</bean>
<bean id="cityDao" class="com.delivery_spring.delivery.dao.city.CityDaoImpl">
<property name="jdbcTemplate" ref="jdbcTemplate"></property>
</bean>
</beans>
Answer the question
In order to leave comments, you need to log in
<property name="url" value="jdbc:postgresql://mobster-db.host:5432/еуые"/>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question