Hi,

I have 3 ideas.

Idea 1:
- check if the statement starts with 
  INSERT, UPDATE, DELETE or SELECT.
- use prepared statement
  conn.prepareStatement(sqlInQuestion)
If it is possible to prepare the statement, then the syntax is ok.

Idea 2:
- create a new (only one) database, with all tables, 
  but no data (no data rows)
- check if the statement starts with 
  INSERT, UPDATE, DELETE or SELECT.
- for INSERT, switch off autocommit (conn.setAutoCommit(false))
- execute the statement
- if it throws a syntax exception, it is not correct
- for INSERT, call rollback

Idea 3:

- for each statement, create your own little 
  in-memory database (for HSQLDB, this is very fast)
- create the required tables (but don't insert data)
  (for HSQLDB, this is very fast)
- execute the statement
- close the database

I hope this helps.

Thomas

-- 
DSL Komplett von GMX +++ Supergünstig und stressfrei einsteigen!
AKTION "Kein Einrichtungspreis" nutzen: http://www.gmx.net/de/go/dsl


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
hsqldb-developers mailing list
hsqldb-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hsqldb-developers

Reply via email to