FileDocCategorySizeDatePackage
SQLUtil.javaAPI DocExample1258Fri Oct 01 15:08:50 BST 1999None

SQLUtil

public class SQLUtil extends SQL
SQLUtil uses SQLParser to parse SQL SELECT statements and
  • either insert (1=2) AND ... at the beginning of every WHERE clause, or
  • remove the entire contents of the WHERE clause with (1=2).
Whenever no top-level WHERE clause exists, WHERE (1=2) will be inserted.
author
jbasu, erohwedd

Fields Summary
Constructors Summary
public SQLUtil(String s)

        super(new SQLTokenManager(new StringCharStream(s)));
  
Methods Summary
public static voidmain(java.lang.String[] args)

    StringBuffer sb = new StringBuffer();

    for (int i=0; i<args.length; i++)
    {
      sb.append(" ");
      sb.append(args[i]);
    }

    SQLUtil su = new SQLUtil(sb.toString());

    try
    {
      su.sql_statement();
      System.out.println("SQL statement accepted.");
    }
    catch (ParseException exn)
    {
      exn.printStackTrace();
      System.out.println("Error in SQL statement: "+exn);
    }