title: Error: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException
body: <p>I'm working on jsp code and have a problem with my db connection. I have two table in my database , <code>ANN</code> and <code>SEC</code> which <code>SEC_ID</code> is <code>primary key</code> and <code>auto increment</code> in <code>SEC</code> table and <code>foreign key</code> in <code>ANN</code> table. I want to use this query in my code </p>
  
  <pre><code>(SELECT 
     DATE, 
     MESSAGE 
  FROM ANN 
  WHERE ANN.SEC_ID = SEC.SEC_ID;) 
  </code></pre>
  
  <p>But when I'm running my program , I've got
  this error: </p>
  
  <pre><code>com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException
  </code></pre>