public static void checkSQLRestriction(DatasourceConnection dc,SQL sql) throws PageException {
  Array sqlparts=ListUtil.listToArrayRemoveEmpty(SQLUtil.removeLiterals(sql.getSQLString())," \t" + System.getProperty("line.separator"));
  DataSource ds=dc.getDatasource();
  if (!ds.hasAllow(DataSource.ALLOW_ALTER))   checkSQLRestriction(dc,"alter",sqlparts,sql);
  if (!ds.hasAllow(DataSource.ALLOW_CREATE))   checkSQLRestriction(dc,"create",sqlparts,sql);
  if (!ds.hasAllow(DataSource.ALLOW_DELETE))   checkSQLRestriction(dc,"delete",sqlparts,sql);
  if (!ds.hasAllow(DataSource.ALLOW_DROP))   checkSQLRestriction(dc,"drop",sqlparts,sql);
  if (!ds.hasAllow(DataSource.ALLOW_GRANT))   checkSQLRestriction(dc,"grant",sqlparts,sql);
  if (!ds.hasAllow(DataSource.ALLOW_INSERT))   checkSQLRestriction(dc,"insert",sqlparts,sql);
  if (!ds.hasAllow(DataSource.ALLOW_REVOKE))   checkSQLRestriction(dc,"revoke",sqlparts,sql);
  if (!ds.hasAllow(DataSource.ALLOW_SELECT))   checkSQLRestriction(dc,"select",sqlparts,sql);
  if (!ds.hasAllow(DataSource.ALLOW_UPDATE))   checkSQLRestriction(dc,"update",sqlparts,sql);
}

public static void checkSQLRestriction ( DatasourceConnection dc , SQL sql ) throws PageException { Array sqlparts = ListUtil . listToArrayRemoveEmpty ( SQLUtil . removeLiterals ( sql . getSQLString ( ) ) , " \t" + System . getProperty ( "line.separator" ) ) ; DataSource ds = dc . getDatasource ( ) ; if ( ! ds . hasAllow ( DataSource . ALLOW_ALTER ) ) checkSQLRestriction ( dc , "alter" , sqlparts , sql ) ; if ( ! ds . hasAllow ( DataSource . ALLOW_CREATE ) ) checkSQLRestriction ( dc , "create" , sqlparts , sql ) ; if ( ! ds . hasAllow ( DataSource . ALLOW_DELETE ) ) checkSQLRestriction ( dc , "delete" , sqlparts , sql ) ; if ( ! ds . hasAllow ( DataSource . ALLOW_DROP ) ) checkSQLRestriction ( dc , "drop" , sqlparts , sql ) ; if ( ! ds . hasAllow ( DataSource . ALLOW_GRANT ) ) checkSQLRestriction ( dc , "grant" , sqlparts , sql ) ; if ( ! ds . hasAllow ( DataSource . ALLOW_INSERT ) ) checkSQLRestriction ( dc , "insert" , sqlparts , sql ) ; if ( ! ds . hasAllow ( DataSource . ALLOW_REVOKE ) ) checkSQLRestriction ( dc , "revoke" , sqlparts , sql ) ; if ( ! ds . hasAllow ( DataSource . ALLOW_SELECT ) ) checkSQLRestriction ( dc , "select" , sqlparts , sql ) ; if ( ! ds . hasAllow ( DataSource . ALLOW_UPDATE ) ) checkSQLRestriction ( dc , "update" , sqlparts , sql ) ; }
check if there is a sql restriction
