public PDBConnection GetConnection(string serverName) { string tmpName = serverName.ToLower(); if (!connPoolDic_.ContainsKey(tmpName)) { ServerItem serItem = TableSet.GetImpl().GetServerInfo(tmpName); if (serItem == null) { throw new Exception("server not found"); } string connStr = string.Format("server={0};port={1};username={2};password={3}", serItem.IP, serItem.Port, serItem.User, serItem.Pwd); lock (this) { if (!connPoolDic_.ContainsKey(tmpName)) { connPoolDic_.Add(tmpName, new ConnectionPool(connStr, serItem.MaxConn)); } } } return(connPoolDic_[tmpName].GetConnection()); }
public Startup(IConfiguration configuration) { Configuration = configuration; TableSet.GetImpl().LoadCfg(); }