I used Swing to create a GUI that creates a database(s) on one of our servers, but I keep getting a "syntax error near "GO" line 2" in my query. If I do a println I can run the output on our SQL server just fine, no errors. So I am not sure what it is balking at. Any ideas?

Java Code:
public class sqlconnection {
    public Connection serverconnection(String username, String pass, Object server){
    Connection con = null;    
     try{
        
        String url = "jdbc:jtds:sqlserver://" + server+ ":1433;domain=MYDOMAIN";
        Class.forName("net.sourceforge.jtds.jdbc.Driver");
        con = DriverManager.getConnection(url, username, pass);
        
           // JOptionPane.showMessageDialog(null,
           // "Database Connected Successfully!", "Connection", 
           // JOptionPane.INFORMATION_MESSAGE);
       }
     catch (SQLException se) { 
        JOptionPane.showMessageDialog(null,
            se.getMessage(), "Connection Problem", 
            JOptionPane.ERROR_MESSAGE);
       }
     catch (Exception e) {
       JOptionPane.showMessageDialog(null,
            e.getMessage(), "Connection Problem", 
            JOptionPane.ERROR_MESSAGE);
       }
    return con;    
  }    
}
Java Code:
public void sqlsingle(String program, Object server, Connection con){
        
        String query;
        ResultSet rs = null;
        java.sql.Statement statement;
        
        String path1 = "S:\\MSSQL\\MSSQL\\data";
        String path2 = "S:\\MSSQL\\data";
        String path3 = "S:\\SQL\\DATA\\MSSQL\\Data";
        String datapath;
      
        if(server == "Server1" || server == "Server6"){
           datapath = path1;
        } else if(server == "Server11" || server == "Server12"|| server == "Server13"){
           datapath = path2;
        } else {
           datapath = path3;
        }
      
        query = "USE master \n" +
                  "GO \n" +                
                  "CREATE DATABASE CQ_" +program+ "_Test \n" +
                  "ON \n" +
                  "(NAME = CQ_" +program+ "_Test_Data, \n" +
                  "FILENAME = '" +datapath+ "\\CQ_" +program+ "_Test_Data.MDF', \n" +
                  "SIZE = 10) \n" +
                  "LOG ON \n" +
                  "(NAME = CQ_" +program+ "_Test_Log, \n" +
                  "FILENAME = '" +datapath+ "\\CQ_" +program+ "_Test_Log.LDF', \n" +
                  "SIZE = 5) \n" +
                  "GO \n\n" +                 
                  "EXEC sp_dboption 'CQ_" +program+ "_Test', 'select into/bulkcopy', 'TRUE' \n" +
                  "GO \n\n" +                  
                  "USE CQ_" +program+ "_Test \n" +
                  "GO \n" +
                  "EXEC sp_grantdbaccess 'CQ_DBO', 'CQ_DBO' \n" +
                  "GO \n" +
                  "EXEC sp_addrolemember 'db_owner', 'CQ_DBO' \n" +
                  "GO \n" +
                  "EXEC sp_grantdbaccess 'harris\\epgpem', 'EPGPEM' \n" +
                  "GO \n" +
                  "EXEC sp_addrolemember 'db_datareader', 'EPGPEM' \n" +
                  "GO \n\n";  
        
             System.out.println(query);
            try {
              statement = con.createStatement();
              rs = statement.executeQuery(query);
            }
            catch (SQLException se) { 
              JOptionPane.showMessageDialog(null,
              se.getMessage(), "Connection Problem", 
              JOptionPane.ERROR_MESSAGE);
            }
           catch (Exception e) {
             JOptionPane.showMessageDialog(null,
             e.getMessage(), "Connection Problem", 
             JOptionPane.ERROR_MESSAGE);
            }               
   }