/** * {@inheritDoc} */ @Override public void delete(@Nonnull final ConnectorRequestContext context, @Nonnull final QualifiedName name) { final String databaseName = name.getDatabaseName(); log.debug("Beginning to drop database {} for request {}", databaseName, context); try (final Connection connection = this.dataSource.getConnection()) { JdbcConnectorUtils.executeUpdate(connection, "DROP DATABASE " + databaseName); log.debug("Finished dropping database {} for request {}", 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(); log.debug("Beginning to drop database {} for request {}", databaseName, context); try (final Connection connection = this.dataSource.getConnection()) { JdbcConnectorUtils.executeUpdate(connection, "DROP DATABASE " + databaseName); log.debug("Finished dropping database {} for request {}", databaseName, context); } catch (final SQLException se) { throw this.exceptionMapper.toConnectorException(se, name); } }
/** * {@inheritDoc} */ @Override public void create(@Nonnull final ConnectorRequestContext context, @Nonnull final DatabaseInfo resource) { final String databaseName = resource.getName().getDatabaseName(); log.debug("Beginning to create database {} for request {}", databaseName, context); try (final Connection connection = this.dataSource.getConnection()) { JdbcConnectorUtils.executeUpdate(connection, "CREATE DATABASE " + databaseName); log.debug("Finished creating database {} for request {}", databaseName, context); } catch (final SQLException se) { throw this.exceptionMapper.toConnectorException(se, resource.getName()); } }
/** * {@inheritDoc} */ @Override public void create(@Nonnull final ConnectorRequestContext context, @Nonnull final DatabaseInfo resource) { final String databaseName = resource.getName().getDatabaseName(); log.debug("Beginning to create database {} for request {}", databaseName, context); try (final Connection connection = this.dataSource.getConnection()) { JdbcConnectorUtils.executeUpdate(connection, "CREATE DATABASE " + databaseName); log.debug("Finished creating database {} for request {}", databaseName, context); } catch (final SQLException se) { throw this.exceptionMapper.toConnectorException(se, resource.getName()); } }
/** * {@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); } }
JdbcConnectorUtils.executeUpdate( connection, this.getRenameTableSql(oldName, oldTableName, newTableName)
JdbcConnectorUtils.executeUpdate( connection, this.getRenameTableSql(oldName, oldTableName, newTableName)