public void addResults(Test test, UUID batchId, Boolean persist) {

        if(persist!=null){

            Config config = Config.getInstance();


            String dburl = "jdbc:mysql://" + config.configProperties.getProperty("db.hostname") + ":" + config.configProperties.getProperty("db.port") + "/" + config.configProperties.getProperty("db.dbname") + "?autoReconnect=true";
            String username = config.configProperties.getProperty("db.user");
            String password = config.configProperties.getProperty("db.password");

            try {
                Class.forName("com.mysql.jdbc.Driver").newInstance();
                conn = DriverManager.getConnection(dburl, username, password);


            } catch (Exception e) {
                System.out.println("Could not connect to database.");
                e.printStackTrace();
                //System.exit(0);
            }



            String env = System.getenv("ENV");
            String tableName = env.substring(0, 1).toUpperCase() + env.substring(1).toLowerCase() + "TestResults";
            try {
                String sql = "insert into " + tableName + "(testName,passed,failed,exceptions,batchId,type,createdTime,module,category,subcategory) values ('" + test.getName() + "','" + test.getPassed() + "','" + test.getFailed() + "','" + test.getException() + "','" + batchId + "','" + test.getType() + "','" + getCurrentTime() + "','" + test.getModule() + "','" + test.getFeature() + "','" + test.getSubfeature() + "')";
                PreparedStatement ps = (PreparedStatement) conn.prepareStatement(sql);
                ps.execute(sql);
                ps.close();
            } catch (Exception e) {
                e.printStackTrace();
            }

            try {
                //conn.close();
            } catch (Exception exp) {
                exp.printStackTrace();

            }
        }
    }