Interface Meta
-
- All Known Subinterfaces:
ProtobufMeta
- All Known Implementing Classes:
MetaImpl,RemoteMeta
public interface MetaCommand handler for getting various metadata. Should be implemented by each driver.Also holds other abstract methods that are not related to metadata that each provider must implement. This is not ideal.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classMeta.ConnectionHandleConnection handle.static interfaceMeta.ConnectionPropertiesA pojo containing various client-settableConnectionproperties.static classMeta.CursorFactoryInformation necessary to convert anIterableinto aCursor.static classMeta.DatabasePropertyDatabase property.static classMeta.ExecuteBatchResultResponse from a collection of SQL commands or parameter values in a single batch.static classMeta.ExecuteResultResponse from execute.static interfaceMeta.FactoryFactory to create instances ofMeta.static classMeta.FrameA collection of rows.static classMeta.MetaResultSetMeta data from which a result set can be constructed.static classMeta.PatWrapper to remind API calls that a parameter is a pattern (allows '%' and '_' wildcards, per the JDBC spec) rather than a string to be matched exactly.static interfaceMeta.PrepareCallbackAPI to put a result set into a statement, being careful to enforce thread-safety and not to overwrite existing open result sets.static classMeta.SignatureResult of preparing a statement.static classMeta.StatementHandleStatement handle.static classMeta.StatementTypeType of statement.static classMeta.StyleHow logical fields are represented in the objects returned by the iterator.
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description voidcloseConnection(Meta.ConnectionHandle ch)Closes a connectionvoidcloseStatement(Meta.StatementHandle h)Closes a statement.voidcommit(Meta.ConnectionHandle ch)Makes all changes since the last commit/rollback permanent.Meta.ConnectionPropertiesconnectionSync(Meta.ConnectionHandle ch, Meta.ConnectionProperties connProps)Synchronizes client and server view of connection properties.java.lang.Iterable<java.lang.Object>createIterable(Meta.StatementHandle stmt, QueryState state, Meta.Signature signature, java.util.List<TypedValue> parameters, Meta.Frame firstFrame)Creates an iterable for a result set.Meta.StatementHandlecreateStatement(Meta.ConnectionHandle ch)Called during the creation of a statement to allocate a new handle.Meta.ExecuteResultexecute(Meta.StatementHandle h, java.util.List<TypedValue> parameterValues, int maxRowsInFirstFrame)Executes a prepared statement.Meta.ExecuteResultexecute(Meta.StatementHandle h, java.util.List<TypedValue> parameterValues, long maxRowCount)Deprecated.Meta.ExecuteBatchResultexecuteBatch(Meta.StatementHandle h, java.util.List<java.util.List<TypedValue>> parameterValues)Executes a collection of bound parameter values on a prepared statement.Meta.Framefetch(Meta.StatementHandle h, long offset, int fetchMaxRowCount)Returns a frame of rows.Meta.MetaResultSetgetAttributes(Meta.ConnectionHandle ch, java.lang.String catalog, Meta.Pat schemaPattern, Meta.Pat typeNamePattern, Meta.Pat attributeNamePattern)PerDatabaseMetaData.getAttributes(String, String, String, String).Meta.MetaResultSetgetBestRowIdentifier(Meta.ConnectionHandle ch, java.lang.String catalog, java.lang.String schema, java.lang.String table, int scope, boolean nullable)PerDatabaseMetaData.getBestRowIdentifier(String, String, String, int, boolean).Meta.MetaResultSetgetCatalogs(Meta.ConnectionHandle ch)PerDatabaseMetaData.getCatalogs().Meta.MetaResultSetgetClientInfoProperties(Meta.ConnectionHandle ch)PerDatabaseMetaData.getClientInfoProperties().Meta.MetaResultSetgetColumnPrivileges(Meta.ConnectionHandle ch, java.lang.String catalog, java.lang.String schema, java.lang.String table, Meta.Pat columnNamePattern)PerDatabaseMetaData.getColumnPrivileges(String, String, String, String).Meta.MetaResultSetgetColumns(Meta.ConnectionHandle ch, java.lang.String catalog, Meta.Pat schemaPattern, Meta.Pat tableNamePattern, Meta.Pat columnNamePattern)PerDatabaseMetaData.getColumns(String, String, String, String).Meta.MetaResultSetgetCrossReference(Meta.ConnectionHandle ch, java.lang.String parentCatalog, java.lang.String parentSchema, java.lang.String parentTable, java.lang.String foreignCatalog, java.lang.String foreignSchema, java.lang.String foreignTable)PerDatabaseMetaData.getCrossReference(String, String, String, String, String, String).java.util.Map<Meta.DatabaseProperty,java.lang.Object>getDatabaseProperties(Meta.ConnectionHandle ch)Returns a map of static database properties.Meta.MetaResultSetgetExportedKeys(Meta.ConnectionHandle ch, java.lang.String catalog, java.lang.String schema, java.lang.String table)PerDatabaseMetaData.getExportedKeys(String, String, String).Meta.MetaResultSetgetFunctionColumns(Meta.ConnectionHandle ch, java.lang.String catalog, Meta.Pat schemaPattern, Meta.Pat functionNamePattern, Meta.Pat columnNamePattern)PerDatabaseMetaData.getFunctionColumns(String, String, String, String).Meta.MetaResultSetgetFunctions(Meta.ConnectionHandle ch, java.lang.String catalog, Meta.Pat schemaPattern, Meta.Pat functionNamePattern)PerDatabaseMetaData.getFunctions(String, String, String).Meta.MetaResultSetgetImportedKeys(Meta.ConnectionHandle ch, java.lang.String catalog, java.lang.String schema, java.lang.String table)PerDatabaseMetaData.getImportedKeys(String, String, String).Meta.MetaResultSetgetIndexInfo(Meta.ConnectionHandle ch, java.lang.String catalog, java.lang.String schema, java.lang.String table, boolean unique, boolean approximate)PerDatabaseMetaData.getIndexInfo(String, String, String, boolean, boolean).Meta.MetaResultSetgetPrimaryKeys(Meta.ConnectionHandle ch, java.lang.String catalog, java.lang.String schema, java.lang.String table)PerDatabaseMetaData.getPrimaryKeys(String, String, String).Meta.MetaResultSetgetProcedureColumns(Meta.ConnectionHandle ch, java.lang.String catalog, Meta.Pat schemaPattern, Meta.Pat procedureNamePattern, Meta.Pat columnNamePattern)PerDatabaseMetaData.getProcedureColumns(String, String, String, String).Meta.MetaResultSetgetProcedures(Meta.ConnectionHandle ch, java.lang.String catalog, Meta.Pat schemaPattern, Meta.Pat procedureNamePattern)PerDatabaseMetaData.getProcedures(String, String, String).Meta.MetaResultSetgetPseudoColumns(Meta.ConnectionHandle ch, java.lang.String catalog, Meta.Pat schemaPattern, Meta.Pat tableNamePattern, Meta.Pat columnNamePattern)PerDatabaseMetaData.getPseudoColumns(String, String, String, String).Meta.MetaResultSetgetSchemas(Meta.ConnectionHandle ch, java.lang.String catalog, Meta.Pat schemaPattern)Meta.MetaResultSetgetSuperTables(Meta.ConnectionHandle ch, java.lang.String catalog, Meta.Pat schemaPattern, Meta.Pat tableNamePattern)PerDatabaseMetaData.getSuperTables(String, String, String).Meta.MetaResultSetgetSuperTypes(Meta.ConnectionHandle ch, java.lang.String catalog, Meta.Pat schemaPattern, Meta.Pat typeNamePattern)PerDatabaseMetaData.getSuperTypes(String, String, String).Meta.MetaResultSetgetTablePrivileges(Meta.ConnectionHandle ch, java.lang.String catalog, Meta.Pat schemaPattern, Meta.Pat tableNamePattern)PerDatabaseMetaData.getTablePrivileges(String, String, String).Meta.MetaResultSetgetTables(Meta.ConnectionHandle ch, java.lang.String catalog, Meta.Pat schemaPattern, Meta.Pat tableNamePattern, java.util.List<java.lang.String> typeList)PerDatabaseMetaData.getTables(String, String, String, String[]).Meta.MetaResultSetgetTableTypes(Meta.ConnectionHandle ch)PerDatabaseMetaData.getTableTypes().Meta.MetaResultSetgetTypeInfo(Meta.ConnectionHandle ch)PerDatabaseMetaData.getTypeInfo().Meta.MetaResultSetgetUDTs(Meta.ConnectionHandle ch, java.lang.String catalog, Meta.Pat schemaPattern, Meta.Pat typeNamePattern, int[] types)PerDatabaseMetaData.getUDTs(String, String, String, int[]).Meta.MetaResultSetgetVersionColumns(Meta.ConnectionHandle ch, java.lang.String catalog, java.lang.String schema, java.lang.String table)PerDatabaseMetaData.getVersionColumns(String, String, String).voidopenConnection(Meta.ConnectionHandle ch, java.util.Map<java.lang.String,java.lang.String> info)Opens (creates) a connection.Meta.StatementHandleprepare(Meta.ConnectionHandle ch, java.lang.String sql, long maxRowCount)Prepares a statement.Meta.ExecuteResultprepareAndExecute(Meta.StatementHandle h, java.lang.String sql, long maxRowCount, int maxRowsInFirstFrame, Meta.PrepareCallback callback)Prepares and executes a statement.Meta.ExecuteResultprepareAndExecute(Meta.StatementHandle h, java.lang.String sql, long maxRowCount, Meta.PrepareCallback callback)Meta.ExecuteBatchResultprepareAndExecuteBatch(Meta.StatementHandle h, java.util.List<java.lang.String> sqlCommands)Prepares a statement and then executes a number of SQL commands in one pass.voidrollback(Meta.ConnectionHandle ch)Undoes all changes since the last commit/rollback.booleansyncResults(Meta.StatementHandle sh, QueryState state, long offset)Re-sets theResultSeton a Statement.
-
-
-
Method Detail
-
getDatabaseProperties
java.util.Map<Meta.DatabaseProperty,java.lang.Object> getDatabaseProperties(Meta.ConnectionHandle ch)
Returns a map of static database properties.The provider can omit properties whose value is the same as the default.
-
getTables
Meta.MetaResultSet getTables(Meta.ConnectionHandle ch, java.lang.String catalog, Meta.Pat schemaPattern, Meta.Pat tableNamePattern, java.util.List<java.lang.String> typeList)
PerDatabaseMetaData.getTables(String, String, String, String[]).
-
getColumns
Meta.MetaResultSet getColumns(Meta.ConnectionHandle ch, java.lang.String catalog, Meta.Pat schemaPattern, Meta.Pat tableNamePattern, Meta.Pat columnNamePattern)
PerDatabaseMetaData.getColumns(String, String, String, String).
-
getSchemas
Meta.MetaResultSet getSchemas(Meta.ConnectionHandle ch, java.lang.String catalog, Meta.Pat schemaPattern)
-
getCatalogs
Meta.MetaResultSet getCatalogs(Meta.ConnectionHandle ch)
PerDatabaseMetaData.getCatalogs().
-
getTableTypes
Meta.MetaResultSet getTableTypes(Meta.ConnectionHandle ch)
PerDatabaseMetaData.getTableTypes().
-
getProcedures
Meta.MetaResultSet getProcedures(Meta.ConnectionHandle ch, java.lang.String catalog, Meta.Pat schemaPattern, Meta.Pat procedureNamePattern)
PerDatabaseMetaData.getProcedures(String, String, String).
-
getProcedureColumns
Meta.MetaResultSet getProcedureColumns(Meta.ConnectionHandle ch, java.lang.String catalog, Meta.Pat schemaPattern, Meta.Pat procedureNamePattern, Meta.Pat columnNamePattern)
PerDatabaseMetaData.getProcedureColumns(String, String, String, String).
-
getColumnPrivileges
Meta.MetaResultSet getColumnPrivileges(Meta.ConnectionHandle ch, java.lang.String catalog, java.lang.String schema, java.lang.String table, Meta.Pat columnNamePattern)
PerDatabaseMetaData.getColumnPrivileges(String, String, String, String).
-
getTablePrivileges
Meta.MetaResultSet getTablePrivileges(Meta.ConnectionHandle ch, java.lang.String catalog, Meta.Pat schemaPattern, Meta.Pat tableNamePattern)
PerDatabaseMetaData.getTablePrivileges(String, String, String).
-
getBestRowIdentifier
Meta.MetaResultSet getBestRowIdentifier(Meta.ConnectionHandle ch, java.lang.String catalog, java.lang.String schema, java.lang.String table, int scope, boolean nullable)
PerDatabaseMetaData.getBestRowIdentifier(String, String, String, int, boolean).
-
getVersionColumns
Meta.MetaResultSet getVersionColumns(Meta.ConnectionHandle ch, java.lang.String catalog, java.lang.String schema, java.lang.String table)
PerDatabaseMetaData.getVersionColumns(String, String, String).
-
getPrimaryKeys
Meta.MetaResultSet getPrimaryKeys(Meta.ConnectionHandle ch, java.lang.String catalog, java.lang.String schema, java.lang.String table)
PerDatabaseMetaData.getPrimaryKeys(String, String, String).
-
getImportedKeys
Meta.MetaResultSet getImportedKeys(Meta.ConnectionHandle ch, java.lang.String catalog, java.lang.String schema, java.lang.String table)
PerDatabaseMetaData.getImportedKeys(String, String, String).
-
getExportedKeys
Meta.MetaResultSet getExportedKeys(Meta.ConnectionHandle ch, java.lang.String catalog, java.lang.String schema, java.lang.String table)
PerDatabaseMetaData.getExportedKeys(String, String, String).
-
getCrossReference
Meta.MetaResultSet getCrossReference(Meta.ConnectionHandle ch, java.lang.String parentCatalog, java.lang.String parentSchema, java.lang.String parentTable, java.lang.String foreignCatalog, java.lang.String foreignSchema, java.lang.String foreignTable)
PerDatabaseMetaData.getCrossReference(String, String, String, String, String, String).
-
getTypeInfo
Meta.MetaResultSet getTypeInfo(Meta.ConnectionHandle ch)
PerDatabaseMetaData.getTypeInfo().
-
getIndexInfo
Meta.MetaResultSet getIndexInfo(Meta.ConnectionHandle ch, java.lang.String catalog, java.lang.String schema, java.lang.String table, boolean unique, boolean approximate)
PerDatabaseMetaData.getIndexInfo(String, String, String, boolean, boolean).
-
getUDTs
Meta.MetaResultSet getUDTs(Meta.ConnectionHandle ch, java.lang.String catalog, Meta.Pat schemaPattern, Meta.Pat typeNamePattern, int[] types)
PerDatabaseMetaData.getUDTs(String, String, String, int[]).
-
getSuperTypes
Meta.MetaResultSet getSuperTypes(Meta.ConnectionHandle ch, java.lang.String catalog, Meta.Pat schemaPattern, Meta.Pat typeNamePattern)
PerDatabaseMetaData.getSuperTypes(String, String, String).
-
getSuperTables
Meta.MetaResultSet getSuperTables(Meta.ConnectionHandle ch, java.lang.String catalog, Meta.Pat schemaPattern, Meta.Pat tableNamePattern)
PerDatabaseMetaData.getSuperTables(String, String, String).
-
getAttributes
Meta.MetaResultSet getAttributes(Meta.ConnectionHandle ch, java.lang.String catalog, Meta.Pat schemaPattern, Meta.Pat typeNamePattern, Meta.Pat attributeNamePattern)
PerDatabaseMetaData.getAttributes(String, String, String, String).
-
getClientInfoProperties
Meta.MetaResultSet getClientInfoProperties(Meta.ConnectionHandle ch)
PerDatabaseMetaData.getClientInfoProperties().
-
getFunctions
Meta.MetaResultSet getFunctions(Meta.ConnectionHandle ch, java.lang.String catalog, Meta.Pat schemaPattern, Meta.Pat functionNamePattern)
PerDatabaseMetaData.getFunctions(String, String, String).
-
getFunctionColumns
Meta.MetaResultSet getFunctionColumns(Meta.ConnectionHandle ch, java.lang.String catalog, Meta.Pat schemaPattern, Meta.Pat functionNamePattern, Meta.Pat columnNamePattern)
PerDatabaseMetaData.getFunctionColumns(String, String, String, String).
-
getPseudoColumns
Meta.MetaResultSet getPseudoColumns(Meta.ConnectionHandle ch, java.lang.String catalog, Meta.Pat schemaPattern, Meta.Pat tableNamePattern, Meta.Pat columnNamePattern)
PerDatabaseMetaData.getPseudoColumns(String, String, String, String).
-
createIterable
java.lang.Iterable<java.lang.Object> createIterable(Meta.StatementHandle stmt, QueryState state, Meta.Signature signature, java.util.List<TypedValue> parameters, Meta.Frame firstFrame)
Creates an iterable for a result set.The default implementation just returns
iterable, which it requires to be not null; derived classes may instead choose to execute the relational expression insignature.
-
prepare
Meta.StatementHandle prepare(Meta.ConnectionHandle ch, java.lang.String sql, long maxRowCount)
Prepares a statement.- Parameters:
ch- Connection handlesql- SQL querymaxRowCount- Negative for no limit (different meaning than JDBC)- Returns:
- Signature of prepared statement
-
prepareAndExecute
@Deprecated Meta.ExecuteResult prepareAndExecute(Meta.StatementHandle h, java.lang.String sql, long maxRowCount, Meta.PrepareCallback callback) throws NoSuchStatementException
Prepares and executes a statement.- Parameters:
h- Statement handlesql- SQL querymaxRowCount- Negative for no limit (different meaning than JDBC)callback- Callback to lock, clear and assign cursor- Returns:
- Result containing statement ID, and if a query, a result set and first frame of data
- Throws:
NoSuchStatementException
-
prepareAndExecute
Meta.ExecuteResult prepareAndExecute(Meta.StatementHandle h, java.lang.String sql, long maxRowCount, int maxRowsInFirstFrame, Meta.PrepareCallback callback) throws NoSuchStatementException
Prepares and executes a statement.- Parameters:
h- Statement handlesql- SQL querymaxRowCount- Maximum number of rows for the entire query. Negative for no limit (different meaning than JDBC).maxRowsInFirstFrame- Maximum number of rows for the first frame. This value should always be less than or equal tomaxRowCountas the number of results are guaranteed to be restricted bymaxRowCountand the underlying database.callback- Callback to lock, clear and assign cursor- Returns:
- Result containing statement ID, and if a query, a result set and first frame of data
- Throws:
NoSuchStatementException
-
prepareAndExecuteBatch
Meta.ExecuteBatchResult prepareAndExecuteBatch(Meta.StatementHandle h, java.util.List<java.lang.String> sqlCommands) throws NoSuchStatementException
Prepares a statement and then executes a number of SQL commands in one pass.- Parameters:
h- Statement handlesqlCommands- SQL commands to run- Returns:
- An array of update counts containing one element for each command in the batch.
- Throws:
NoSuchStatementException
-
executeBatch
Meta.ExecuteBatchResult executeBatch(Meta.StatementHandle h, java.util.List<java.util.List<TypedValue>> parameterValues) throws NoSuchStatementException
Executes a collection of bound parameter values on a prepared statement.- Parameters:
h- Statement handleparameterValues- A collection of list of typed values, one list per batch- Returns:
- An array of update counts containing one element for each command in the batch.
- Throws:
NoSuchStatementException
-
fetch
Meta.Frame fetch(Meta.StatementHandle h, long offset, int fetchMaxRowCount) throws NoSuchStatementException, MissingResultsException
Returns a frame of rows.The frame describes whether there may be another frame. If there is not another frame, the current iteration is done when we have finished the rows in the this frame.
The default implementation always returns null.
- Parameters:
h- Statement handleoffset- Zero-based offset of first row in the requested framefetchMaxRowCount- Maximum number of rows to return; negative means no limit- Returns:
- Frame, or null if there are no more
- Throws:
NoSuchStatementExceptionMissingResultsException
-
execute
@Deprecated Meta.ExecuteResult execute(Meta.StatementHandle h, java.util.List<TypedValue> parameterValues, long maxRowCount) throws NoSuchStatementException
Deprecated.Executes a prepared statement.- Parameters:
h- Statement handleparameterValues- A list of parameter values; may be empty, not nullmaxRowCount- Maximum number of rows to return; negative means no limit- Returns:
- Execute result
- Throws:
NoSuchStatementException
-
execute
Meta.ExecuteResult execute(Meta.StatementHandle h, java.util.List<TypedValue> parameterValues, int maxRowsInFirstFrame) throws NoSuchStatementException
Executes a prepared statement.- Parameters:
h- Statement handleparameterValues- A list of parameter values; may be empty, not nullmaxRowsInFirstFrame- Maximum number of rows to return in the Frame.- Returns:
- Execute result
- Throws:
NoSuchStatementException
-
createStatement
Meta.StatementHandle createStatement(Meta.ConnectionHandle ch)
Called during the creation of a statement to allocate a new handle.- Parameters:
ch- Connection handle
-
closeStatement
void closeStatement(Meta.StatementHandle h)
Closes a statement.If the statement handle is not known, or is already closed, does nothing.
- Parameters:
h- Statement handle
-
openConnection
void openConnection(Meta.ConnectionHandle ch, java.util.Map<java.lang.String,java.lang.String> info)
Opens (creates) a connection. The client allocates its own connection ID which the server is then made aware of through theMeta.ConnectionHandle. The Mapinfoargument is analogous to thePropertiestypically passed to a "normal" JDBC Driver. Avatica specific properties should not be included -- only properties for the underlying driver.- Parameters:
ch- A ConnectionHandle encapsulates information about the connection to be opened as provided by the client.info- A Map corresponding to the Properties typically passed to a JDBC Driver.
-
closeConnection
void closeConnection(Meta.ConnectionHandle ch)
Closes a connection
-
syncResults
boolean syncResults(Meta.StatementHandle sh, QueryState state, long offset) throws NoSuchStatementException
Re-sets theResultSeton a Statement. Not a JDBC method.- Returns:
- True if there are results to fetch after resetting to the given offset. False otherwise
- Throws:
NoSuchStatementException
-
commit
void commit(Meta.ConnectionHandle ch)
Makes all changes since the last commit/rollback permanent. Analogous toConnection.commit().- Parameters:
ch- A reference to the real JDBC Connection
-
rollback
void rollback(Meta.ConnectionHandle ch)
Undoes all changes since the last commit/rollback. Analogous toConnection.rollback();- Parameters:
ch- A reference to the real JDBC Connection
-
connectionSync
Meta.ConnectionProperties connectionSync(Meta.ConnectionHandle ch, Meta.ConnectionProperties connProps)
Synchronizes client and server view of connection properties.Note: this interface is considered "experimental" and may undergo further changes as this functionality is extended to other aspects of state management for
Connection,Statement, andResultSet.
-
-