code: synchronized public Connection getDb(String db) throws Exception {
  		Connection con = null;
  		if (nameToConnection.containsKey(db)) {
  			con = nameToConnection.get(db);
  		} else {
  			ConnectionInfo info = nameToInfo.get(db);
  			
  			if( null == info ) {
  				throw new Exception("No information provided for database named: "+db);
  			}
  			
  			try {
  				Class.forName(info.getJdbcClass()); //load the driver
  				con = DriverManager.getConnection(info.getConnectionString(),
  			                                     info.getUserName(),
  			                                     info.getPassword()); //connect to the db
  			    DatabaseMetaData dbmd = con.getMetaData(); //get MetaData to confirm connection
  			    logger.info("Connection to "+dbmd.getDatabaseProductName()+" "+
  			                       dbmd.getDatabaseProductVersion()+" successful.\n");
  
  			    nameToConnection.put(db, con);
  			} catch(Exception e) {
  				throw new Exception("Couldn't get db connection: "+db,e);
  			}
  		}
  		return(con);
  	}
docs: This method checks for the presence of a Connection associated with the input db parameter.
  It attempts to create the Connection and adds it to the connection map if it does not
  already exist.  If the Connection exists or is created, it is returned.
  
  @param db database name.
  @return Returns the desired Connection instance, or null.