title: java json conditional on key name
body: <p>i'm trying to build a sql query from some json data, since the json data i receive always different in the number of fields and contents each time, and all the values are string, so i tried to iterate the json, then convert the values from string to another datatype i.e to_timestamp. but i haven't been able to filter the key name.</p>
  
  <p>i'm very unfamiliar with java. can someone tell me where is my mistake. thanks</p>
  
  <pre><code>    for (String key : jsonObject.keySet()) {
          if (queryKey.length() &gt; 0) {
              queryKey.append(",");
              queryVal.append(",");
          }
  
          queryKey.append(key);
          if ((String)key == "t") {
              queryVal.append("TO_TIMESTAMP('" + jsonObject.get(key) + "','YYYY-MM-DD HH24:MI:SS.FF3')");
          } else { //something else }
  
      }
  </code></pre>