com.codingapi.springboot.permission.initializer.DataSourceInitializer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of springboot-starter-data-permission Show documentation
Show all versions of springboot-starter-data-permission Show documentation
springboot-starter-data-permission project for Spring Boot
package com.codingapi.springboot.permission.initializer;
import com.codingapi.springboot.permission.db.DBTable;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.dbutils.QueryRunner;
import javax.sql.DataSource;
import java.sql.SQLException;
/**
* @author lorne
* @since 1.0.0
*/
@Slf4j
public class DataSourceInitializer {
private final DataSource dataSource;
private final QueryRunner queryRunner;
public DataSourceInitializer(DataSource dataSource) throws SQLException{
this.dataSource = dataSource;
this.queryRunner = new QueryRunner(dataSource);
this.init();
}
private void init() throws SQLException {
DBTable dbTable = new DBTable(dataSource.getConnection());
dbTable.scanner();
dbTable.close();
}
}