All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.codingapi.springboot.permission.initializer.DataSourceInitializer Maven / Gradle / Ivy

There is a newer version: 1.4.0
Show newest version
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();
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy