conn = plmn.connect("jdbc:poolman://" + dbName);
conn.setAutoCommit(true);
} catch (Exception ecs) {
System.out.println(ecs.toString()+"Again:Connect sqlsever faile"+module);
}
}
return conn;
}
public Connection getConnection() {
return getNewConnection();
}
}
GeneralDb.java:
package common.sql;
package common.sql;
import java.util.*;
public class GeneralDb {
private static Hashtable dbPool;
public static MyDB getInstance(String dbname) {
if (dbPool == null) {
dbPool = new Hashtable();
}
MyDB db = (MyDB) dbPool.get(dbname);
if (db == null) {
db = new MyDB(dbname);
dbPool.put(dbname, db);
文章来源于领测软件测试网 https://www.ltesting.net/