/** * {@inheritDoc} */ @Override public void delete(@Nonnull final ConnectorRequestContext context, @Nonnull final QualifiedName name) { final String databaseName = name.getDatabaseName(); final String tableName = name.getTableName(); log.debug("Attempting to delete table {} from database {} for request {}", tableName, databaseName, context); try (Connection connection = this.getConnection(name.getDatabaseName())) { JdbcConnectorUtils.executeUpdate(connection, this.getDropTableSql(name, tableName)); log.debug("Deleted table {} from database {} for request {}", tableName, databaseName, context); } catch (final SQLException se) { throw this.exceptionMapper.toConnectorException(se, name); } }
/** * {@inheritDoc} */ @Override public void delete(@Nonnull final ConnectorRequestContext context, @Nonnull final QualifiedName name) { final String databaseName = name.getDatabaseName(); final String tableName = name.getTableName(); log.debug("Attempting to delete table {} from database {} for request {}", tableName, databaseName, context); try (Connection connection = this.getConnection(name.getDatabaseName())) { JdbcConnectorUtils.executeUpdate(connection, this.getDropTableSql(name, tableName)); log.debug("Deleted table {} from database {} for request {}", tableName, databaseName, context); } catch (final SQLException se) { throw this.exceptionMapper.toConnectorException(se, name); } }
final String database = name.getDatabaseName(); try (Connection connection = this.getConnection(database)) { final List<QualifiedName> names = Lists.newArrayList(); try (ResultSet tables = this.getTables(connection, name, prefix)) {
final String database = name.getDatabaseName(); try (Connection connection = this.getConnection(database)) { final List<QualifiedName> names = Lists.newArrayList(); try (ResultSet tables = this.getTables(connection, name, prefix)) {
); try (Connection connection = this.getConnection(oldDatabaseName)) { connection.setSchema(oldDatabaseName); JdbcConnectorUtils.executeUpdate(
); try (Connection connection = this.getConnection(oldDatabaseName)) { connection.setSchema(oldDatabaseName); JdbcConnectorUtils.executeUpdate(
log.debug("Beginning to get table metadata for qualified name {} for request {}", name, context); try (Connection connection = this.getConnection(name.getDatabaseName())) { final ImmutableList.Builder<FieldInfo> fields = ImmutableList.builder(); try (ResultSet columns = this.getColumns(connection, name)) {
log.debug("Beginning to get table metadata for qualified name {} for request {}", name, context); try (Connection connection = this.getConnection(name.getDatabaseName())) { final ImmutableList.Builder<FieldInfo> fields = ImmutableList.builder(); try (ResultSet columns = this.getColumns(connection, name)) {