title: Java sql : syntax error encountered at line xx column xx
body: <p>im getting an error that saying "Syntex Error : Encountered "year" at line 1 column 69"</p>
  
  <p>here is my code </p>
  
  <pre><code>public void UpdateRecord(String sql1, String sql2, String sql3, String sql4, int sql5, String sql6) {
      try {
  
          PreparedStatement stt = conn.prepareStatement("update Students set ic = ?, name = ?, level = ?, programmecode = ?, year = ? where id = " + sql6);
  
          stt.setString(1, sql1);
          stt.setString(2, sql2);
          stt.setString(3, sql3);
          stt.setString(4, sql4);
          stt.setInt(5, sql5);
          //stt.setString(6, sql6);
          stt.executeUpdate();
  
          //stt.close();
  
  
      } catch (SQLException ex) {
          JOptionPane.showMessageDialog(null, ex.getMessage(), "ERROR", JOptionPane.ERROR_MESSAGE);
      }
  
  }
  </code></pre>
  
  <p>although the exception stated the mistake origin from the "YEAR" but i failed to find any</p>
  
  <p>here the sql table</p>
  
  <pre><code>CREATE TABLE STUDENTS ( 
  ID VARCHAR(10) not null primary key, 
  IC VARCHAR(14) unique, 
  NAME VARCHAR(50), 
  LEVEL CHAR(1), 
  PROGRAMMECODE VARCHAR(3), 
  YEAR INTEGER, 
  foreign key (PROGRAMMECODE) references PROGRAMMES(CODE) 
  ); 
  </code></pre>