Query syntax is checked at java level or Database Level? If i used normal JDBC Connection for accessing database of Mysql, The syntax of query is checked at java level or Mysql level.

Example

String Query="Select * fromEMP"

above wrong query syntax throw a SQLException.

so this exception is actually thrown by MySQL or java.
Two different things probably:


Syntax is checked in MySQL server. There may be connectors/client libraries which would do the parsing and checking before sending it, but it would only mean doing the same work twice. MySQL server receives query as string and then processes it. Even for prepared statements server receives statement as text and compiles it.
SQLException is probably extended Java Exception, which is purely Java side construct (generally as part of JDBC code). So this exception is thrown by Java MySQL client library when it sends your query and instead of data, server returns some error message. Client and server communicate by socket or tcp, so there is no way how server could throw exception directly to client. It has to signalize error by some other means (probably different response packet type or something similar)