Class ArrowFlightSqlClientHandler
java.lang.Object
org.apache.arrow.driver.jdbc.client.ArrowFlightSqlClientHandler
- All Implemented Interfaces:
AutoCloseable
A
FlightSqlClient
handler.-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
Builder forArrowFlightSqlClientHandler
.static interface
A prepared statement handler. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Makes an RPC "getCatalogs" request.getCrossReference
(String pkCatalog, String pkSchema, String pkTable, String fkCatalog, String fkSchema, String fkTable) Makes an RPC "getCrossReference" request based on the provided info.getExportedKeys
(String catalog, String schema, String table) Makes an RPC "getExportedKeys" request based on the provided info.getImportedKeys
(String catalog, String schema, String table) Makes an RPC "getImportedKeys" request based on the provided info.Makes an RPC "getInfo" request based on the providedquery
object.getPrimaryKeys
(String catalog, String schema, String table) Makes an RPC "getPrimaryKeys" request based on the provided info.getSchemas
(String catalog, String schemaPattern) Makes an RPC "getSchemas" request based on the provided info.getSqlInfo
(FlightSql.SqlInfo... info) Gets SQL info.getStreams
(FlightInfo flightInfo) Makes an RPC "getStream" request based on the providedFlightInfo
object.getTables
(String catalog, String schemaPattern, String tableNamePattern, List<String> types, boolean includeSchema) Makes an RPC "getTables" request based on the provided info.Makes an RPC "getTableTypes" request.Creates a newArrowFlightSqlClientHandler.PreparedStatement
for the givenquery
.
-
Method Details
-
getStreams
Makes an RPC "getStream" request based on the providedFlightInfo
object. Retrieves the result of the query previously prepared with "getInfo."- Parameters:
flightInfo
- TheFlightInfo
instance from which to fetch results.- Returns:
- a
FlightStream
of results. - Throws:
SQLException
-
getInfo
Makes an RPC "getInfo" request based on the providedquery
object.- Parameters:
query
- The query.- Returns:
- a
FlightStream
of results.
-
close
- Specified by:
close
in interfaceAutoCloseable
- Throws:
SQLException
-
prepare
Creates a newArrowFlightSqlClientHandler.PreparedStatement
for the givenquery
.- Parameters:
query
- the SQL query.- Returns:
- a new prepared statement.
-
getCatalogs
Makes an RPC "getCatalogs" request.- Returns:
- a
FlightStream
of results.
-
getImportedKeys
Makes an RPC "getImportedKeys" request based on the provided info.- Parameters:
catalog
- The catalog name. Must match the catalog name as it is stored in the database. Retrieves those without a catalog. Null means that the catalog name should not be used to narrow the search.schema
- The schema name. Must match the schema name as it is stored in the database. "" retrieves those without a schema. Null means that the schema name should not be used to narrow the search.table
- The table name. Must match the table name as it is stored in the database.- Returns:
- a
FlightStream
of results.
-
getExportedKeys
Makes an RPC "getExportedKeys" request based on the provided info.- Parameters:
catalog
- The catalog name. Must match the catalog name as it is stored in the database. Retrieves those without a catalog. Null means that the catalog name should not be used to narrow the search.schema
- The schema name. Must match the schema name as it is stored in the database. "" retrieves those without a schema. Null means that the schema name should not be used to narrow the search.table
- The table name. Must match the table name as it is stored in the database.- Returns:
- a
FlightStream
of results.
-
getSchemas
Makes an RPC "getSchemas" request based on the provided info.- Parameters:
catalog
- The catalog name. Must match the catalog name as it is stored in the database. Retrieves those without a catalog. Null means that the catalog name should not be used to narrow the search.schemaPattern
- The schema name pattern. Must match the schema name as it is stored in the database. Null means that schema name should not be used to narrow down the search.- Returns:
- a
FlightStream
of results.
-
getTableTypes
Makes an RPC "getTableTypes" request.- Returns:
- a
FlightStream
of results.
-
getTables
public FlightInfo getTables(String catalog, String schemaPattern, String tableNamePattern, List<String> types, boolean includeSchema) Makes an RPC "getTables" request based on the provided info.- Parameters:
catalog
- The catalog name. Must match the catalog name as it is stored in the database. Retrieves those without a catalog. Null means that the catalog name should not be used to narrow the search.schemaPattern
- The schema name pattern. Must match the schema name as it is stored in the database. "" retrieves those without a schema. Null means that the schema name should not be used to narrow the search.tableNamePattern
- The table name pattern. Must match the table name as it is stored in the database.types
- The list of table types, which must be from the list of table types to include. Null returns all types.includeSchema
- Whether to include schema.- Returns:
- a
FlightStream
of results.
-
getSqlInfo
Gets SQL info.- Returns:
- the SQL info.
-
getPrimaryKeys
Makes an RPC "getPrimaryKeys" request based on the provided info.- Parameters:
catalog
- The catalog name; must match the catalog name as it is stored in the database. "" retrieves those without a catalog. Null means that the catalog name should not be used to narrow the search.schema
- The schema name; must match the schema name as it is stored in the database. "" retrieves those without a schema. Null means that the schema name should not be used to narrow the search.table
- The table name. Must match the table name as it is stored in the database.- Returns:
- a
FlightStream
of results.
-
getCrossReference
public FlightInfo getCrossReference(String pkCatalog, String pkSchema, String pkTable, String fkCatalog, String fkSchema, String fkTable) Makes an RPC "getCrossReference" request based on the provided info.- Parameters:
pkCatalog
- The catalog name. Must match the catalog name as it is stored in the database. Retrieves those without a catalog. Null means that the catalog name should not be used to narrow the search.pkSchema
- The schema name. Must match the schema name as it is stored in the database. "" retrieves those without a schema. Null means that the schema name should not be used to narrow the search.pkTable
- The table name. Must match the table name as it is stored in the database.fkCatalog
- The catalog name. Must match the catalog name as it is stored in the database. Retrieves those without a catalog. Null means that the catalog name should not be used to narrow the search.fkSchema
- The schema name. Must match the schema name as it is stored in the database. "" retrieves those without a schema. Null means that the schema name should not be used to narrow the search.fkTable
- The table name. Must match the table name as it is stored in the database.- Returns:
- a
FlightStream
of results.
-