private static void buildTillageForage(Statement in, Statement outA, Statement outB, String inTbl, String outTbl, String outTblHru, int type, int[] data, boolean isConv, Connection c) {
        try {
            ResultSet inRs = in.executeQuery("SELECT * FROM " + inTbl + ";");
            ResultSet outRs = outA.executeQuery("SELECT * FROM " + outTbl + ";");
            String outColumnNames = loadOutputColumnNames(outRs);
            int[] ids = loadTillageForageIds(inRs, data);
            String sql = "INSERT INTO " + outTbl + "(" + outColumnNames + "VALUES(";
            for(int i = 0; i < ids.length; i++) {
                outA.executeUpdate(sql + ids[i] + ");");
            }
            c.commit();
            System.out.println("\n" + outTbl + " database created successfully");
            inRs = outA.executeQuery("SELECT * FROM " + outTbl + ";");
            outRs = outB.executeQuery("SELECT * FROM " + outTblHru + ";");
            outColumnNames = loadOutputColumnNames(outRs);
            sql = "INSERT INTO " + outTblHru + "(" + outColumnNames + "VALUES(";
            int[] hrus;
            int tillageType = 4;
            if(outTbl.equals("tillage")) {
                if(isConv) {
                    tillageType = 56;
                }
            }
            if(type == 2) {
                hrus = loadTillageForageHrus(in, "hru_subbasin", type, ids);
            }
            else if(type == 1) {
                hrus = loadTillageForageHrus(in, "hru_field", type, ids);
            }
            else {
                hrus = loadTillageForageHrus(in, "hru_field", type, ids);
            }
            for(int i = 0; i < hrus.length; i++) {
                if(outTbl.equals("tillage")) {
                    outB.executeUpdate(sql + hrus[i] + ", " + tillageType + ");");
                }
                else {
                    outB.executeUpdate(sql + hrus[i] + ");");
                }
            }
            c.commit();
            System.out.println("\n" + outTblHru + " database created successfully");
        } catch (SQLException e) {
            Logger.getLogger(BuildDB.class.getName()).log(Level.SEVERE, null, e);
        }
    }