Java application to generate SQL queries