com.oath.micro.server.spring.datasource.jdbc.SQL Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of micro-jdbc Show documentation
Show all versions of micro-jdbc Show documentation
Opinionated rest microservices
package com.oath.micro.server.spring.datasource.jdbc;
import org.springframework.beans.factory.annotation.Qualifier;
import javax.sql.DataSource;
import lombok.Getter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Component;
@Component
@Getter
public class SQL {
private final JdbcTemplate jdbc;
@Autowired
public SQL(@Qualifier("mainDataSource") DataSource dataSource) {
jdbc = new JdbcTemplate(dataSource);
}
}