private void handleDropTable() throws SqlJetException { CommonTree options = (CommonTree) ast.getChild(0); boolean ifExists = options.getChildCount() > 0 && "exists".equalsIgnoreCase(options.getChild(0).getText()); String tableName = ast.getChild(1).getText(); if (db.getSchema().getTable(tableName) != null) { db.dropTable(tableName); } else if (!ifExists) { throw new SqlJetException(SqlJetErrorCode.ERROR, "Table does not exists."); } }