title: Syntax error: Encountered "t" at line 1, column 54
body: <p>I'm getting an error that says "Syntax error: Encountered "t" at line 1, column 54"</p>
  
  <p>This only seems to happen when the enhanced for loop for the History list iterates more than once. It works perfectly fine when I add one row of items, but when I add any more it gives me this error</p>
  
  <p>Here is my code:</p>
  
  <pre><code>public void databaseSave( ArrayList &lt;Patient&gt; pList )
  {
  
      try
      {
          stmt = getConnection().createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
  
          //Statement stmt = con.createStatement();
  
          //Deletes all records from the Patient Table.
          deleteAllFromPatientTable();
  
          //Selects all the records from the Patient table.
          selectAllFromPatient();
  
  
          System.out.println("Before loop");
  
          for ( Patient p: pList )
          {
  
              patientInsertSQL = "Insert Into SHAUN.PATIENT VALUES (" + p.getPatientNum() + ", '"
              + p.getPatientName() + "', '" + p.getPatientAddress() + "', '"
              + p.getPatientPhone() + "')";
  
              res = stmt.executeUpdate(patientInsertSQL); 
  
              System.out.println(res);
  
  
              ArrayList &lt;History&gt; tempHistList = p.getHistory();
  
              //Deletes all the records from the history table.
              deleteAllFromHistoryTable();
  
              //Selects all the records from the history table.
              selectAllFromHistory();
  
              for ( History h: tempHistList )
              {                   
                  historyInsertSQL = "Insert Into SHAUN.HISTORY VALUES (" + h.getHistID() + ", '" + h.getConditionName() + "', '" + h.getMedication() + "', '" + h.getDateOccured() + "', " + p.getPatientNum() + ")";
  
                  res = stmt.executeUpdate(historyInsertSQL); 
  
                  System.out.println(res);
  
                  //Loop Checker
                  int i = 1;
                  System.out.println("In the History Loop " + i);
                  i++;
              }
  
              System.out.println("In the loop!");
  
          }
  
          stmt.close();
          result.close();
          con.commit();
  
          System.out.println("After Loop and close");
  
      }
      catch (SQLException err)
      {
          System.out.print(err.getMessage());
      }
  }
  </code></pre>