title: How to validate sql query syntax?
body: <p>java 1.4
  Sql server 2000</p>
  
  <p>i am taking input of sql query (for validation of field value against values retrieved by executing sql query) from admin user which will be stored in database and later i will executing sql query corresponding to field.Before inserting sql query in database i want to validate its syntax in java code.  </p>
  
  <pre><code>Fields         Sql Query
  
  stateCode      select statecode from states
  district code  select district code from districts
  </code></pre>