Advertisement
Guest User

Untitled

a guest
Oct 14th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.74 KB | None | 0 0
  1. package pl.edu.agh.sbatko.configuration;
  2.  
  3. import org.springframework.context.annotation.Bean;
  4. import org.springframework.context.annotation.Configuration;
  5. import org.springframework.jdbc.datasource.DriverManagerDataSource;
  6.  
  7. import javax.sql.DataSource;
  8.  
  9. /**
  10.  * Created by sebastian on 14.10.17.
  11.  */
  12. @Configuration
  13. public class Config {
  14.  
  15.     @Bean(name = "datasource")
  16.     public DataSource dataSource() {
  17.         DriverManagerDataSource dataSource = new DriverManagerDataSource();
  18.         dataSource.setDriverClassName("org.postgresql.Driver");
  19.         dataSource.setUrl("jdbc:postgresql://localhost:5432/postgres");
  20.         dataSource.setUsername("postgres");
  21.         dataSource.setPassword("postgres");
  22.         return dataSource;
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement