- ConfigReader conf;
-
- /* Delete all the SQLConn objects in the connection lists,
- * this will call their destructors where they can handle
- * closing connections and such.
- */
- for(ConnMap::iterator iter = connections.begin(); iter != connections.end(); iter++)
- {
- DELETE(iter->second);
- }
-
- /* Empty out our list of connections */
- connections.clear();
-
- for(int i = 0; i < conf.Enumerate("database"); i++)
- {
- std::string id;
- SQLConn* newconn;
-
- id = conf.ReadValue("database", "id", i);
- newconn = new SQLConn(Srv, conf.ReadValue("database", "hostname", i),
- conf.ReadInteger("database", "port", i, true),
- conf.ReadValue("database", "name", i),
- conf.ReadValue("database", "username", i),
- conf.ReadValue("database", "password", i),
- conf.ReadFlag("database", "ssl", i));
-
- connections.insert(std::make_pair(id, newconn));
- }