public static void initDBFactory(String environment, String db) throws Exception{
        if (db.equals("Projects")){     
            try{
                String resource = "com/cds/mybatis/mybatis-config-projects.xml";
                Reader reader = Resources.getResourceAsReader(resource);
                if (sqlProjectSessionFactory == null){
                    Log.info("Запуск SqlProjectSessionFactory");
                    sqlProjectSessionFactory = new SqlSessionFactoryBuilder().build(reader, environment);
                    sqlProjectSessionFactory.getConfiguration().addMapper(ProjectsMapper.class);
                }            
            }catch(Exception e){
                Log.log(Level.SEVERE, ERROR_DB_PROJECT, e);
            }
        }if (db.equals("Data")){
            try{          
                String resource = "com/cds/mybatis/mybatis-config-data.xml";
                Reader reader = Resources.getResourceAsReader(resource);
                if (sqlDataSessionFactory == null){
                    Log.info("Запуск SqlDataSessionFactory");
                    sqlDataSessionFactory = new SqlSessionFactoryBuilder().build(reader, environment);
                    sqlDataSessionFactory.getConfiguration().addMapper(DataMapper.class);
                }
            }catch(Exception e){
                Log.log(Level.SEVERE, ERROR_DB_DATA, e);
            }
        }
    }