tools.c3p0.database.DatabaseAccessFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of java-autotest-tool Show documentation
Show all versions of java-autotest-tool Show documentation
This is an integration of autotest tools
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;
}
}