Query by extension name, table name, and column name

@param extensionName
extension name
@param tableName
table name
@param columnName
column name
@return extensions
@throws SQLException
upon failure
499640
public Extensions queryByExtension(String extensionName, String tableName,
			String columnName) throws SQLException {

		QueryBuilder<Extensions, Void> qb = queryBuilder();

		setUniqueWhere(qb.where(), extensionName, true, tableName, true,
				columnName);

		List<Extensions> extensions = qb.query();

		Extensions extension = null;
		if (extensions.size() > 1) {
			throw new GeoPackageException("More than one "
					+ Extensions.class.getSimpleName()
					+ " existed for unique combination of Extension Name: "
					+ extensionName + ", Table Name: " + tableName
					+ ", Column Name: " + columnName);
		} else if (extensions.size() == 1) {
			extension = extensions.get(0);
		}

		return extension;
	}
844008
func (p *ExtensionManagerClient) GetQueryColumns(ctx context.Context, sql string) (r *ExtensionResponse, err error) {
  var _args31 ExtensionManagerGetQueryColumnsArgs
  _args31.Sql = sql
  var _result32 ExtensionManagerGetQueryColumnsResult
  if err = p.Client_().Call(ctx, "getQueryColumns", &_args31, &_result32); err != nil {
    return
  }
  return _result32.GetSuccess(), nil
}
81881
@Override
  public ResultSet executeQuery(String sql) throws SQLException
  {
    raiseSQLExceptionIfStatementIsClosed();
    return executeQueryInternal(sql, null);
  }
225022
@Override
    public ResultSet getTables(String catalog, String schemaPattern, String tableNamePattern, String[] types) throws SQLException
    {
        checkClosed();
        this.sysCatalog.setString(1, "TABLES");
        JDBC4ResultSet res = (JDBC4ResultSet) this.sysCatalog.executeQuery();
        VoltTable vtable = res.getVoltTable().clone(0);

        List<String> typeStrings = null;
        if (types != null) {
            typeStrings = Arrays.asList(types);
        }

        // If no pattern is specified, default to matching any/all.
        if (tableNamePattern == null || tableNamePattern.length() == 0)
        {
            tableNamePattern = "%";
        }

        Pattern table_pattern = computeJavaPattern(tableNamePattern);

        // Filter tables based on type and pattern
        while (res.next()) {
            if (typeStrings == null || typeStrings.contains(res.getString("TABLE_TYPE"))) {
                Matcher table_matcher = table_pattern.matcher(res.getString("TABLE_NAME"));
                if (table_matcher.matches())
                {
                    vtable.addRow(res.getRowData());
                }
            }
        }

        return new JDBC4ResultSet(this.sysCatalog, vtable);
    }
902355
public boolean has(String tableName, String columnName,
			GeometryType geometryType) {

		String extensionName = getExtensionName(geometryType);
		boolean exists = has(extensionName, tableName, columnName);

		return exists;
	}
281334
public function getExtension(
        /*# string */ $extensionName
    )/*# : ExtensionAbstract */ {
        if (!$this->hasExtension($extensionName)) {
            $this->addExtension(new $extensionName);
        }
        return $this->extensions[$extensionName];
    }
463444
public int deleteByTableName(String tableName) throws SQLException {
		DeleteBuilder<MetadataReference, Void> db = deleteBuilder();
		db.where().eq(MetadataReference.COLUMN_TABLE_NAME, tableName);
		PreparedDelete<MetadataReference> deleteQuery = db.prepare();
		int deleted = delete(deleteQuery);
		return deleted;
	}
520632
@Override
	public String onTableName(String tableName) {
		if (onlyBindParameter)
			return null;

		if (currentSchema != null) {
			Finder<SQLProperty> finder = currentSchema.getEntityBySimpleName(tableName);
			AssertKripton.assertTrueOrUnknownClassInJQLException(finder != null, currentMethod, tableName);
			return finder.getTableName();
		} else {
			return null;
		}
	}
911650
public Extension getExtension(String name) {
        if (name != null) {
            for (int i = 0; i < extensionList.size(); i++) {
                Extension p = getExtension(i);
                if (p.getName().equalsIgnoreCase(name)) {
                    return p;
                }
            }
        }
        
        return null;
    }
335456
public function getColumnType($tableName, $columnName) {
        $columns = $this->getTableColumns($tableName);
        foreach ($columns as $column) {
            if ($column['Field'] != $columnName)
                continue;
            $type = explode('(', $column['Type'], 2);
            return $type[0];
        }
        throw new \Exception("Column `$columnName` not found in table `$tableName`!");
    }
631415
public int deleteByTableName(String tableName) throws SQLException {
		DeleteBuilder<DataColumns, TableColumnKey> db = deleteBuilder();
		db.where().eq(DataColumns.COLUMN_TABLE_NAME, tableName);
		PreparedDelete<DataColumns> deleteQuery = db.prepare();
		int deleted = delete(deleteQuery);
		return deleted;
	}
810169
@Override
    public ResultScanner getScanner(String tableName, Scan scan) {
	logger.debug("OMID Begin of getScanner(" + tableName + ", " + scan + ")");
        TTable tTable = (TTable)getTable(tableName);
        ResultScanner resScanner = null;
        try {
            resScanner = tTable.getScanner(t1, scan);
        } catch (IOException e) {
            logger.error("Error while trying to obtain a ResultScanner: " + tableName);
            logger.error(e.getMessage());
        }
        return resScanner;
    }
777221
public Optional<String> getAssistedQueryColumn(final String logicTableName, final String columnName) {
        if (assistedQueryColumns.isEmpty()) {
            return Optional.absent();
        }
        for (ColumnNode each : columns) {
            ColumnNode target = new ColumnNode(logicTableName, columnName);
            if (each.equals(target)) {
                return Optional.of(assistedQueryColumns.get(columns.indexOf(target)).getColumnName());
            }
        }
        return Optional.absent();
    }
1234154
public int deleteByTableName(String tableName) throws SQLException {
		DeleteBuilder<FeatureTileLink, FeatureTileLinkKey> db = deleteBuilder();

		db.where().eq(FeatureTileLink.COLUMN_FEATURE_TABLE_NAME, tableName)
				.or().eq(FeatureTileLink.COLUMN_TILE_TABLE_NAME, tableName);

		PreparedDelete<FeatureTileLink> deleteQuery = db.prepare();
		int deleted = delete(deleteQuery);
		return deleted;
	}
853045
protected List<String> getAllColumns(String tableName) {
        List<String> columns = new ArrayList<String>();
        try {
            // Lower-case table names are required for PostgreSQL; we might need to
            // alter this if we use another comparison database (besides HSQL) someday
            ResultSet rs = dbconn.getMetaData().getColumns(null, null, tableName.toLowerCase(), null);
            while (rs.next()) {
                columns.add(rs.getString(4));
            }
        } catch (SQLException e) {
            printCaughtException("In NonVoltDBBackend.getAllColumns, caught SQLException: " + e);
        }
        return columns;
    }
592457
public List<ExtendedRelation> getBaseTableRelations(String baseTable)
			throws SQLException {
		return queryForEq(ExtendedRelation.COLUMN_BASE_TABLE_NAME, baseTable);
	}
35350
private void executeSQL(String sqlName, String tableName,
			String geometryColumnName) {
		executeSQL(sqlName, tableName, geometryColumnName, null);
	}