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

tools.c3p0.database.DatabaseAccessFactory Maven / Gradle / Ivy

There is a newer version: 0.2.2
Show newest version
package tools.c3p0.database;
import org.apache.log4j.Logger;
import org.testng.Reporter;

/**
 * Created by zhengyu06 on 2017/9/12
 */

public class DatabaseAccessFactory {
    private static Logger log = Logger.getLogger(DatabaseAccessFactory.class);
    private static DatabaseAccessInterface dai = null;
//    public static DatabaseAccessInterface getDataAccessInstance(String dbInfo){
//        log.trace(String.format("Get DBInfo %s", dbInfo));
//        if (!DBConnectionManager.getPoolMap().containsKey(dbInfo)){
//            dai = new DatabaseAccessImpl(dbInfo);
//            Reporter.log("new DatabaseAccessImpl("+dbInfo+") has been called.",true);
//        }
//        return dai;
//    }

    public static DatabaseAccessInterface getDataAccessInstance(String dbInfo){
        log.trace(String.format("Get DBInfo %s", dbInfo));
        dai = new DatabaseAccessImpl(dbInfo);
        Reporter.log("new DatabaseAccessImpl("+dbInfo+") has been called.",true);
        return dai;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy