Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package pl.edu.agh.sbatko.configuration;
- import org.springframework.context.annotation.Bean;
- import org.springframework.context.annotation.Configuration;
- import org.springframework.jdbc.datasource.DriverManagerDataSource;
- import javax.sql.DataSource;
- /**
- * Created by sebastian on 14.10.17.
- */
- @Configuration
- public class Config {
- @Bean(name = "datasource")
- public DataSource dataSource() {
- DriverManagerDataSource dataSource = new DriverManagerDataSource();
- dataSource.setDriverClassName("org.postgresql.Driver");
- dataSource.setUrl("jdbc:postgresql://localhost:5432/postgres");
- dataSource.setUsername("postgres");
- dataSource.setPassword("postgres");
- return dataSource;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement