@SqlQuery throws org.skife.jdbi.v2.exceptions.UnableToExecuteStatementException: java.sql.SQLException: SQL Anywhere Error -131
<p>When I execute :</p>

<pre><code>  @SqlQuery("select A.field1, A.field2, C.field3, C.field4, C.field5 from "
  + "table1 A, table2 B, table3 C WHERE A.field2 &gt;= '1500' AND A.field2 &lt; '9500' "
  + "AND A.field1 NOT IN (SELECT field1 FROM table4) AND A.field1 = B.field1  AND "
  + "(B.field3 = 'NAME' OR B.field3 ='STRT') order by A.field1 ASC") 
</code></pre>

<p>I keep on getting the below error:</p>

<pre><code>problem parsing template 'c2VsZWN0IEEuVVBDX05VTSwgQS5NT0RVTEVfTlVNLCBDLkNIUl9OTSwgQy5DSFJfQ0QsIEMuVkwgZnJvbSBVUEMgQSwgVVBDX0NIUiBCLCBDSFJfVkwgQyBXSEVSRSBBLk1PRFVMRV9OVU0gPj0gJzEwMDAnIEFORCBBLk1PRFVMRV9OVU0gPCAnOTAwMCcgQU5EIEEuVVBDX05VTSBOT1QgSU4gKFNFTEVDVCBVUENfTlVNIEZST00gVVBDX0FDVFYpIEFORCBBLlVQQ19OVU0gPSBCLlVQQ19OVU0gIEFORCAoQi5DSFJfTk0gPSAnQlJBTkQnIE9SIEIuQ0hSX05NID0nVFlQRScpIEFORCBCLk1PRFVMRV9OVU0gPSBDLk1PRFVMRV9OVU0gIEFORCBCLkNIUl9OTSA9IEMuQ0hSX05NICBBTkQgQi5DSFJfQ0QgPSBDLkNIUl9DRCBvcmRlciBieSBBLlVQQ19OVU0gQVND'
line 1:373: expecting '&gt;', found '&lt;EOF&gt;'
at org.antlr.stringtemplate.language.AngleBracketTemplateLexer.nextToken(AngleBracketTemplateLexer.java:149)
at antlr.TokenBuffer.fill(TokenBuffer.java:69)
at antlr.TokenBuffer.LA(TokenBuffer.java:80)
at antlr.LLkParser.LA(LLkParser.java:52)
at org.antlr.stringtemplate.language.TemplateParser.template(TemplateParser.java:103)
at org.antlr.stringtemplate.StringTemplate.breakTemplateIntoChunks(StringTemplate.java:850)
at org.antlr.stringtemplate.StringTemplate.setTemplate(StringTemplate.java:441)
at org.antlr.stringtemplate.StringTemplateGroup.defineTemplate(StringTemplateGroup.java:679)
at org.skife.jdbi.v2.sqlobject.stringtemplate.StringTemplate3StatementLocator.locate(StringTemplate3StatementLocator.java:260)
at org.skife.jdbi.v2.SQLStatement.wrapLookup(SQLStatement.java:1284)
at org.skife.jdbi.v2.SQLStatement.internalExecute(SQLStatement.java:1293)
at org.skife.jdbi.v2.Query.iterator(Query.java:240)
at org.skife.jdbi.v2.sqlobject.ResultReturnThing$IteratorResultReturnThing.result(ResultReturnThing.java:162)
at org.skife.jdbi.v2.sqlobject.ResultReturnThing.map(ResultReturnThing.java:43)
at org.skife.jdbi.v2.sqlobject.QueryHandler.invoke(QueryHandler.java:43)
at org.skife.jdbi.v2.sqlobject.SqlObject.invoke(SqlObject.java:212)
at org.skife.jdbi.v2.sqlobject.SqlObject$2.intercept(SqlObject.java:109)
at com.test.project.MyDAO$$EnhancerByCGLIB$$96e97b19.usTest(&lt;generated&gt;)
at com.test.project.Main.getDataDb(Main.java:300)
at com.test.project.Main.run(Main.java:130)
at com.test.project.Main.main(Main.java:83)
Exception in thread "main" org.skife.jdbi.v2.exceptions.UnableToExecuteStatementException: java.sql.SQLException: SQL Anywhere Error -131: Syntax error near '(end of line)' on line 1 [statement:"select A.field1, A.field2, C.field3, C.field4, C.field5 from table1 A, table2 B, table3 C WHERE A.field2 &gt;= '1500' AND A.field2 &lt; '9500' AND A.field1 NOT IN (SELECT field1 FROM table4) AND A.field1 = B.field1  AND (B.field3 = 'NAME' OR B.field3 ='STRT') order by A.field1 ASC", located:"select A.field1, A.field2, C.field3, C.field4, C.field5 from table1 A, table2 B, table3 C WHERE A.field2 &gt;= '1500' AND A.field2 &lt;  ", arguments:{ positional:{}, named:{}, finder:[]}]
at org.skife.jdbi.v2.SQLStatement.internalExecute(SQLStatement.java:1337)
at org.skife.jdbi.v2.Query.iterator(Query.java:240)
at org.skife.jdbi.v2.sqlobject.ResultReturnThing$IteratorResultReturnThing.result(ResultReturnThing.java:162)
at org.skife.jdbi.v2.sqlobject.ResultReturnThing.map(ResultReturnThing.java:43)
at org.skife.jdbi.v2.sqlobject.QueryHandler.invoke(QueryHandler.java:43)
at org.skife.jdbi.v2.sqlobject.SqlObject.invoke(SqlObject.java:212)
at org.skife.jdbi.v2.sqlobject.SqlObject$2.intercept(SqlObject.java:109)
at com.test.project.MyDAO$$EnhancerByCGLIB$$96e97b19.usTest(&lt;generated&gt;)
at com.test.project.Main.getDataDb(Main.java:300)
at com.test.project.Main.run(Main.java:130)
at com.test.project.Main.main(Main.java:83)
Caused by: java.sql.SQLException: SQL Anywhere Error -131: Syntax error near '(end of line)' on line 1
at com.sybase.jdbc4.jdbc.SybConnection.getAllExceptions(Unknown Source)
at com.sybase.jdbc4.jdbc.SybStatement.handleSQLE(Unknown Source)
at com.sybase.jdbc4.jdbc.SybStatement.nextResult(Unknown Source)
at com.sybase.jdbc4.jdbc.SybStatement.nextResult(Unknown Source)
at com.sybase.jdbc4.jdbc.SybStatement.executeLoop(Unknown Source)
at com.sybase.jdbc4.jdbc.SybStatement.execute(Unknown Source)
at com.sybase.jdbc4.jdbc.SybPreparedStatement.execute(Unknown Source)
at org.skife.jdbi.v2.SQLStatement.internalExecute(SQLStatement.java:1326)
... 10 more
</code></pre>

<p>When I remove this <code>A.field2 &lt; '9500'</code>, the query works fine. Is the &lt; reason for the issue? </p>