Class JdbcCatalog
- java.lang.Object
-
- org.apache.flink.table.catalog.AbstractCatalog
-
- org.apache.flink.connector.jdbc.catalog.AbstractJdbcCatalog
-
- org.apache.flink.connector.jdbc.catalog.JdbcCatalog
-
- All Implemented Interfaces:
org.apache.flink.table.catalog.Catalog
@PublicEvolving public class JdbcCatalog extends AbstractJdbcCatalog
Catalogs for relational databases via JDBC.
-
-
Field Summary
-
Fields inherited from class org.apache.flink.connector.jdbc.catalog.AbstractJdbcCatalog
baseUrl, defaultUrl, pwd, userClassLoader, username
-
-
Constructor Summary
Constructors Constructor Description JdbcCatalog(ClassLoader userClassLoader, String catalogName, String defaultDatabase, String username, String pwd, String baseUrl)Creates a JdbcCatalog.JdbcCatalog(String catalogName, String defaultDatabase, String username, String pwd, String baseUrl)Deprecated.please useJdbcCatalog(ClassLoader, String, String, String, String, String)instead.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.flink.table.catalog.CatalogDatabasegetDatabase(String databaseName)AbstractJdbcCataloggetInternal()org.apache.flink.table.catalog.CatalogBaseTablegetTable(org.apache.flink.table.catalog.ObjectPath tablePath)List<String>listDatabases()List<String>listTables(String databaseName)booleantableExists(org.apache.flink.table.catalog.ObjectPath tablePath)-
Methods inherited from class org.apache.flink.connector.jdbc.catalog.AbstractJdbcCatalog
alterDatabase, alterFunction, alterPartition, alterPartitionColumnStatistics, alterPartitionStatistics, alterTable, alterTableColumnStatistics, alterTableStatistics, close, createDatabase, createFunction, createPartition, createTable, databaseExists, dropDatabase, dropFunction, dropPartition, dropTable, extractColumnValuesBySQL, fromJDBCType, functionExists, getBaseUrl, getFactory, getFunction, getPartition, getPartitionColumnStatistics, getPartitionStatistics, getPassword, getPrimaryKey, getSchemaName, getSchemaTableName, getTableColumnStatistics, getTableName, getTableStatistics, getUsername, listFunctions, listPartitions, listPartitions, listPartitionsByFilter, listViews, open, partitionExists, renameTable
-
Methods inherited from class org.apache.flink.table.catalog.AbstractCatalog
getDefaultDatabase, getName
-
-
-
-
Constructor Detail
-
JdbcCatalog
public JdbcCatalog(String catalogName, String defaultDatabase, String username, String pwd, String baseUrl)
Deprecated.please useJdbcCatalog(ClassLoader, String, String, String, String, String)instead.Creates a JdbcCatalog.
-
JdbcCatalog
public JdbcCatalog(ClassLoader userClassLoader, String catalogName, String defaultDatabase, String username, String pwd, String baseUrl)
Creates a JdbcCatalog.- Parameters:
userClassLoader- the classloader used to load JDBC drivercatalogName- the registered catalog namedefaultDatabase- the default database nameusername- the username used to connect the databasepwd- the password used to connect the databasebaseUrl- the base URL of the database, e.g. jdbc:mysql://localhost:3306
-
-
Method Detail
-
listDatabases
public List<String> listDatabases() throws org.apache.flink.table.catalog.exceptions.CatalogException
- Throws:
org.apache.flink.table.catalog.exceptions.CatalogException
-
getDatabase
public org.apache.flink.table.catalog.CatalogDatabase getDatabase(String databaseName) throws org.apache.flink.table.catalog.exceptions.DatabaseNotExistException, org.apache.flink.table.catalog.exceptions.CatalogException
- Specified by:
getDatabasein interfaceorg.apache.flink.table.catalog.Catalog- Overrides:
getDatabasein classAbstractJdbcCatalog- Throws:
org.apache.flink.table.catalog.exceptions.DatabaseNotExistExceptionorg.apache.flink.table.catalog.exceptions.CatalogException
-
listTables
public List<String> listTables(String databaseName) throws org.apache.flink.table.catalog.exceptions.DatabaseNotExistException, org.apache.flink.table.catalog.exceptions.CatalogException
- Throws:
org.apache.flink.table.catalog.exceptions.DatabaseNotExistExceptionorg.apache.flink.table.catalog.exceptions.CatalogException
-
getTable
public org.apache.flink.table.catalog.CatalogBaseTable getTable(org.apache.flink.table.catalog.ObjectPath tablePath) throws org.apache.flink.table.catalog.exceptions.TableNotExistException, org.apache.flink.table.catalog.exceptions.CatalogException- Specified by:
getTablein interfaceorg.apache.flink.table.catalog.Catalog- Overrides:
getTablein classAbstractJdbcCatalog- Throws:
org.apache.flink.table.catalog.exceptions.TableNotExistExceptionorg.apache.flink.table.catalog.exceptions.CatalogException
-
tableExists
public boolean tableExists(org.apache.flink.table.catalog.ObjectPath tablePath) throws org.apache.flink.table.catalog.exceptions.CatalogException- Throws:
org.apache.flink.table.catalog.exceptions.CatalogException
-
getInternal
@VisibleForTesting @Internal public AbstractJdbcCatalog getInternal()
-
-