title: MSSQL - Invalid column name with Java/JTDS
body: <p>I have read all the threads about my problem and all of them finish without solution... 
  Anyway I hope to be luckier...</p>
  
  <p>I'm trying to use JDBC to connect to the MSSQL db.
  I used the driver from Microsoft sqljdbc4.jar and I had no problem.
  Since I have to switch to JTDS (I'm using 1.2.8) I got this exception when I try to run the same SQL string:</p>
  
  <pre><code>java.sql.SQLException: Invalid column name 'id'.    at
  net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:372)
      at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2894)
      at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2334)   at
  net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:643)  at
  net.sourceforge.jtds.jdbc.JtdsStatement.executeSQLQuery(JtdsStatement.java:506)
      at
  net.sourceforge.jtds.jdbc.JtdsStatement.executeQuery(JtdsStatement.java:1433)
  </code></pre>
  
  <p>The string is </p>
  
  <pre><code>SELECT tabledatastoreitem.name, tabledatastoreitem.path
  FROM tabledatastoreitem, store, service, serviceprovider
  WHERE tabledatastoreitem.store_id = store.id
      AND store.service_store_id = service.id
      AND service.serviceprovider_id = serviceprovider.id
      AND serviceprovider.name = 'SystemIService'
      AND store.createdttm &lt; CONVERT(varchar(100), DATEADD(MI, -7, GETDATE()));
  </code></pre>
  
  <p>Any idea?</p>