From 8464a36db5a604589f1b8d0ff3bc88a3cd18c79f Mon Sep 17 00:00:00 2001
From: grantnert48 <tobias.grantner@tuwien.ac.at>
Date: Mon, 12 Jun 2023 18:17:55 +0200
Subject: [PATCH] Removed dependencies on docker from query service

---
 .../java/at/tuwien/config/MariaDbConfig.java  | 124 ++++++---
 dbrepo-query-service/pom.xml                  |  51 ++--
 .../at/tuwien/endpoint/ExportEndpoint.java    |  17 +-
 .../at/tuwien/endpoint/QueryEndpoint.java     |  64 ++---
 .../at/tuwien/endpoint/StoreEndpoint.java     |  45 ++--
 .../at/tuwien/endpoint/TableDataEndpoint.java |  73 +++---
 .../tuwien/endpoint/TableHistoryEndpoint.java |  14 +-
 .../java/at/tuwien/endpoint/ViewEndpoint.java |  65 +++--
 .../tuwien/validation/EndpointValidator.java  |   8 +-
 .../tuwien/config/MariaDbContainerConfig.java |  70 +++++
 .../endpoint/ExportEndpointUnitTest.java      |  32 +--
 .../endpoint/QueryEndpointUnitTest.java       |  94 +++----
 .../endpoint/StoreEndpointUnitTest.java       |  64 ++---
 .../endpoint/TableDataEndpointUnitTest.java   | 127 +++++----
 .../TableHistoryEndpointUnitTest.java         |  19 +-
 .../tuwien/endpoint/ViewEndpointUnitTest.java | 118 +++++----
 .../RabbitMqListenerIntegrationTest.java      |  45 ++--
 .../ViewIdxRepositoryIntegrationTest.java     |  59 +++--
 .../service/QueryServiceIntegrationTest.java  | 246 +++++++-----------
 .../service/QueueServiceIntegrationTest.java  |  66 +++--
 .../StoreServiceIntegrationModifyTest.java    | 121 ++++-----
 .../StoreServiceIntegrationReadTest.java      |  52 ++--
 .../TableServiceIntegrationReadTest.java      |  56 ++--
 .../tuwien/service/TableServiceUnitTest.java  |  13 +-
 .../service/ViewServiceIntegrationTest.java   |  43 ++-
 .../src/test/resources/application.properties |  22 +-
 .../src/test/resources/init/musicology.sql    |  18 ++
 .../src/test/resources/init/querystore.sql    |   5 +
 .../src/test/resources/init/schema.sql        |   1 +
 .../src/test/resources/init/users.sql         |   4 +
 .../src/test/resources/init/weather.sql       |  70 +++++
 .../src/test/resources/init/zoo.sql           | 199 ++++++++++++++
 .../test/resources/sensor/1_querystore.sql    |   0
 .../src/test/resources/sensor/2_traffic.sql   |   0
 .../test/resources/traffic/1_querystore.sql   |   0
 .../src/test/resources/traffic/2_traffic.sql  |   0
 .../test/resources/weather/1_querystore.sql   |   0
 .../src/test/resources/weather/2_weather.sql  |   0
 .../src/test/resources/zoo/1_querystore.sql   |   0
 .../src/test/resources/zoo/2_zoo.sql          |   0
 .../java/at/tuwien/amqp/RabbitMqConsumer.java |  13 +-
 .../java/at/tuwien/config/AmqpConfig.java     |   4 +
 .../at/tuwien/config/WebSecurityConfig.java   |  19 +-
 .../java/at/tuwien/mapper/DatabaseMapper.java |  39 ---
 .../java/at/tuwien/mapper/QueryMapper.java    |  29 ++-
 .../repository/mdb/DatabaseRepository.java    |   4 +-
 .../repository/mdb/TableRepository.java       |   5 +-
 .../at/tuwien/service/DatabaseService.java    |   4 +-
 .../tuwien/service/MessageQueueService.java   |   4 +-
 .../java/at/tuwien/service/QueryService.java  |  87 +++----
 .../java/at/tuwien/service/StoreService.java  |  18 +-
 .../java/at/tuwien/service/TableService.java  |   7 +-
 .../java/at/tuwien/service/ViewService.java   |   6 +-
 .../service/impl/DatabaseServiceImpl.java     |   6 +-
 .../service/impl/HibernateConnector.java      |  19 +-
 .../tuwien/service/impl/QueryServiceImpl.java | 152 +++++------
 .../service/impl/RabbitMqServiceImpl.java     |  13 +-
 .../tuwien/service/impl/StoreServiceImpl.java |  65 ++---
 .../tuwien/service/impl/TableServiceImpl.java |  30 +--
 .../tuwien/service/impl/ViewServiceImpl.java  |  27 +-
 .../src/test/resources/application.properties |  20 --
 61 files changed, 1389 insertions(+), 1187 deletions(-)
 create mode 100644 dbrepo-query-service/rest-service/src/test/java/at/tuwien/config/MariaDbContainerConfig.java
 create mode 100644 dbrepo-query-service/rest-service/src/test/resources/init/musicology.sql
 create mode 100644 dbrepo-query-service/rest-service/src/test/resources/init/querystore.sql
 create mode 100644 dbrepo-query-service/rest-service/src/test/resources/init/schema.sql
 create mode 100644 dbrepo-query-service/rest-service/src/test/resources/init/users.sql
 create mode 100644 dbrepo-query-service/rest-service/src/test/resources/init/weather.sql
 create mode 100644 dbrepo-query-service/rest-service/src/test/resources/init/zoo.sql
 delete mode 100644 dbrepo-query-service/rest-service/src/test/resources/sensor/1_querystore.sql
 delete mode 100644 dbrepo-query-service/rest-service/src/test/resources/sensor/2_traffic.sql
 delete mode 100644 dbrepo-query-service/rest-service/src/test/resources/traffic/1_querystore.sql
 delete mode 100644 dbrepo-query-service/rest-service/src/test/resources/traffic/2_traffic.sql
 delete mode 100644 dbrepo-query-service/rest-service/src/test/resources/weather/1_querystore.sql
 delete mode 100644 dbrepo-query-service/rest-service/src/test/resources/weather/2_weather.sql
 delete mode 100644 dbrepo-query-service/rest-service/src/test/resources/zoo/1_querystore.sql
 delete mode 100644 dbrepo-query-service/rest-service/src/test/resources/zoo/2_zoo.sql
 delete mode 100644 dbrepo-query-service/services/src/main/java/at/tuwien/mapper/DatabaseMapper.java
 delete mode 100644 dbrepo-query-service/services/src/test/resources/application.properties

diff --git a/dbrepo-metadata-db/test/src/main/java/at/tuwien/config/MariaDbConfig.java b/dbrepo-metadata-db/test/src/main/java/at/tuwien/config/MariaDbConfig.java
index 8d00a9e77e..bbab1efee9 100644
--- a/dbrepo-metadata-db/test/src/main/java/at/tuwien/config/MariaDbConfig.java
+++ b/dbrepo-metadata-db/test/src/main/java/at/tuwien/config/MariaDbConfig.java
@@ -1,8 +1,12 @@
 package at.tuwien.config;
 
+import at.tuwien.entities.container.Container;
+import at.tuwien.entities.database.Database;
 import at.tuwien.querystore.Query;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.context.annotation.Configuration;
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.jdbc.datasource.init.ResourceDatabasePopulator;
 
 import java.sql.*;
 import java.util.HashMap;
@@ -14,54 +18,92 @@ import java.util.Map;
 @Configuration
 public class MariaDbConfig {
 
-    public static void insertQueryStore(String hostname, String database, Query query, String username) throws SQLException {
-        final String jdbc = "jdbc:mariadb://" + hostname + "/" + database;
+    public static void createInitDatabase(Container container, Database database) throws SQLException {
+        final String jdbc = "jdbc:mariadb://" + container.getHost() + ":" + container.getPort();
         log.trace("connect to database {}", jdbc);
-        final Connection connection = DriverManager.getConnection(jdbc, "root", "mariadb");
-        final PreparedStatement prepareStatement = connection.prepareStatement("INSERT INTO qs_queries (created_by, query, query_normalized, is_persisted, query_hash, result_hash, result_number, created, executed) VALUES (?,?,?,?,?,?,?,?,?)");
-        prepareStatement.setString(1, username);
-        prepareStatement.setString(2, query.getQuery());
-        prepareStatement.setString(3, query.getQuery());
-        prepareStatement.setBoolean(4, query.getIsPersisted());
-        prepareStatement.setString(5, query.getQueryHash());
-        prepareStatement.setString(6, query.getResultHash());
-        prepareStatement.setLong(7, query.getResultNumber());
-        prepareStatement.setTimestamp(8, Timestamp.from(query.getCreated()));
-        prepareStatement.setTimestamp(9, Timestamp.from(query.getExecuted()));
-        log.trace("prepared statement: {}", prepareStatement);
-        prepareStatement.executeUpdate();
-        connection.close();
+        try (Connection connection = DriverManager.getConnection(jdbc, container.getPrivilegedUsername(), container.getPrivilegedPassword())) {
+            ResourceDatabasePopulator populator = new ResourceDatabasePopulator(new ClassPathResource("init/" + database.getInternalName() + ".sql"), new ClassPathResource("init/querystore.sql"));
+            populator.setSeparator(";\n");
+            populator.populate(connection);
+        }
     }
 
-    public static List<Map<String, Object>> listQueryStore(String hostname, String database) throws SQLException {
-        final String jdbc = "jdbc:mariadb://" + hostname + "/" + database;
+    public static void dropAllDatabases(Container container) {
+        final String jdbc = "jdbc:mariadb://" + container.getHost() + ":" + container.getPort();
         log.trace("connect to database {}", jdbc);
-        final Connection connection = DriverManager.getConnection(jdbc, "root", "mariadb");
-        final Statement statement = connection.createStatement();
-        final ResultSet result = statement.executeQuery("SELECT created_by, query, query_normalized, is_persisted, query_hash, result_hash, result_number, created, executed FROM qs_queries");
-        final List<Map<String, Object>> rows = new LinkedList<>();
-        while (result.next()) {
-            rows.add(new HashMap<>() {{
-                put("created_by", result.getString(1));
-                put("query", result.getString(2));
-                put("query_normalized", result.getString(3));
-                put("is_persisted", result.getBoolean(4));
-                put("query_hash", result.getString(5));
-                put("result_hash", result.getString(6));
-                put("result_number", result.getLong(7));
-                put("created", result.getTimestamp(8));
-                put("executed", result.getTimestamp(9));
-            }});
+        try (Connection connection = DriverManager.getConnection(jdbc, container.getPrivilegedUsername(), container.getPrivilegedPassword())) {
+            final String sql = "SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME NOT IN ('information_schema', 'mysql', 'performance_schema');";
+            log.trace("prepare statement '{}'", sql);
+            final PreparedStatement statement = connection.prepareStatement(sql);
+            final ResultSet resultSet = statement.executeQuery();
+            final List<String> databases = new LinkedList<>();
+            while (resultSet.next()) {
+                databases.add(resultSet.getString(1));
+            }
+            resultSet.close();
+            statement.close();
+            for (String database : databases) {
+                final String drop = "DROP DATABASE IF EXISTS `" + database + "`;";
+                final PreparedStatement dropStatement = connection.prepareStatement(drop);
+                dropStatement.executeUpdate();
+                dropStatement.close();
+            }
+        } catch (SQLException e) {
+            log.error("could not drop all databases", e);
+        }
+    }
+
+    public static void insertQueryStore(Database database, Query query, String username) throws SQLException {
+        final String jdbc = "jdbc:mariadb://" + database.getContainer().getHost() + ":" + database.getContainer().getPort() + "/" + database.getInternalName();
+        log.trace("connect to database {}", jdbc);
+        try (Connection connection = DriverManager.getConnection(jdbc, database.getContainer().getPrivilegedUsername(), database.getContainer().getPrivilegedPassword())) {
+            final PreparedStatement prepareStatement = connection.prepareStatement(
+                    "INSERT INTO qs_queries (created_by, query, query_normalized, is_persisted, query_hash, result_hash, result_number, created, executed) VALUES (?,?,?,?,?,?,?,?,?)");
+            prepareStatement.setString(1, username);
+            prepareStatement.setString(2, query.getQuery());
+            prepareStatement.setString(3, query.getQuery());
+            prepareStatement.setBoolean(4, query.getIsPersisted());
+            prepareStatement.setString(5, query.getQueryHash());
+            prepareStatement.setString(6, query.getResultHash());
+            prepareStatement.setLong(7, query.getResultNumber());
+            prepareStatement.setTimestamp(8, Timestamp.from(query.getCreated()));
+            prepareStatement.setTimestamp(9, Timestamp.from(query.getExecuted()));
+            log.trace("prepared statement: {}", prepareStatement);
+            prepareStatement.executeUpdate();
+        }
+    }
+
+    public static List<Map<String, Object>> listQueryStore(Database database) throws SQLException {
+        final String jdbc = "jdbc:mariadb://" + database.getContainer().getHost() + ":" + database.getContainer().getPort() + "/" + database.getInternalName();
+        log.trace("connect to database {}", jdbc);
+        try (Connection connection = DriverManager.getConnection(jdbc, database.getContainer().getPrivilegedUsername(), database.getContainer().getPrivilegedPassword())) {
+            final Statement statement = connection.createStatement();
+            final ResultSet result = statement.executeQuery(
+                    "SELECT created_by, query, query_normalized, is_persisted, query_hash, result_hash, result_number, created, executed FROM qs_queries");
+            final List<Map<String, Object>> rows = new LinkedList<>();
+            while (result.next()) {
+                rows.add(new HashMap<>() {{
+                    put("created_by", result.getString(1));
+                    put("query", result.getString(2));
+                    put("query_normalized", result.getString(3));
+                    put("is_persisted", result.getBoolean(4));
+                    put("query_hash", result.getString(5));
+                    put("result_hash", result.getString(6));
+                    put("result_number", result.getLong(7));
+                    put("created", result.getTimestamp(8));
+                    put("executed", result.getTimestamp(9));
+                }});
+            }
+            return rows;
         }
-        return rows;
     }
 
-    public static List<Map<String, String>> selectQuery(String hostname, String database, String query, String... columns)
+    public static List<Map<String, String>> selectQuery(Database database, String query, String... columns)
             throws SQLException {
-        final String jdbc = "jdbc:mariadb://" + hostname + "/" + database;
+        final String jdbc = "jdbc:mariadb://" + database.getContainer().getHost() + ":" + database.getContainer().getPort() + "/" + database.getInternalName();
         log.trace("connect to database {}", jdbc);
         final List<Map<String, String>> rows = new LinkedList<>();
-        try (Connection connection = DriverManager.getConnection(jdbc, "root", "mariadb")) {
+        try (Connection connection = DriverManager.getConnection(jdbc, database.getContainer().getPrivilegedUsername(), database.getContainer().getPrivilegedPassword())) {
             final Statement statement = connection.createStatement();
             final ResultSet result = statement.executeQuery(query);
             while (result.next()) {
@@ -75,11 +117,11 @@ public class MariaDbConfig {
         return rows;
     }
 
-    public static void execute(String hostname, String database, String query)
+    public static void execute(Database database, String query)
             throws SQLException {
-        final String jdbc = "jdbc:mariadb://" + hostname + "/" + database;
+        final String jdbc = "jdbc:mariadb://" + database.getContainer().getHost() + ":" + database.getContainer().getPort() + "/" + database.getInternalName();
         log.trace("connect to database {}", jdbc);
-        try (Connection connection = DriverManager.getConnection(jdbc, "root", "mariadb")) {
+        try (Connection connection = DriverManager.getConnection(jdbc, database.getContainer().getPrivilegedUsername(), database.getContainer().getPrivilegedPassword())) {
             final Statement statement = connection.createStatement();
             statement.executeUpdate(query);
         }
diff --git a/dbrepo-query-service/pom.xml b/dbrepo-query-service/pom.xml
index 73c0a87169..ea6976eb0c 100644
--- a/dbrepo-query-service/pom.xml
+++ b/dbrepo-query-service/pom.xml
@@ -43,7 +43,6 @@
         <java.version>17</java.version>
         <spring-cloud.version>4.0.2</spring-cloud.version>
         <mapstruct.version>1.5.5.Final</mapstruct.version>
-        <docker.version>3.3.0</docker.version>
         <jacoco.version>0.8.10</jacoco.version>
         <jwt.version>4.3.0</jwt.version>
         <opencsv.version>5.7.1</opencsv.version>
@@ -51,6 +50,9 @@
         <c3p0.version>0.9.5.5</c3p0.version>
         <c3p0-hibernate.version>6.2.2.Final</c3p0-hibernate.version>
         <springdoc-openapi.version>2.1.0</springdoc-openapi.version>
+        <hsqldb.version>2.7.2</hsqldb.version>
+        <testcontainers.version>1.18.3</testcontainers.version>
+        <opensearch-testcontainer.version>2.0.0</opensearch-testcontainer.version>
         <opensearch-client.version>1.1.0</opensearch-client.version>
     </properties>
 
@@ -149,24 +151,6 @@
             <artifactId>springdoc-openapi-starter-webmvc-api</artifactId>
             <version>${springdoc-openapi.version}</version>
         </dependency>
-        <!-- Docker -->
-        <dependency>
-            <groupId>com.github.docker-java</groupId>
-            <artifactId>docker-java</artifactId>
-            <version>${docker.version}</version>
-            <exclusions>
-                <exclusion>
-                    <groupId>javax.ws.rs</groupId>
-                    <artifactId>jsr311-api</artifactId>
-                </exclusion>
-            </exclusions>
-        </dependency>
-        <dependency>
-            <groupId>com.github.docker-java</groupId>
-            <artifactId>docker-java-transport-httpclient5</artifactId>
-            <version>${docker.version}</version>
-        </dependency>
-        <!-- IDE -->
         <dependency>
             <groupId>org.projectlombok</groupId>
             <artifactId>lombok</artifactId>
@@ -209,8 +193,33 @@
             </exclusions>
         </dependency>
         <dependency>
-            <groupId>com.h2database</groupId>
-            <artifactId>h2</artifactId>
+            <groupId>org.hsqldb</groupId>
+            <artifactId>hsqldb</artifactId>
+            <version>${hsqldb.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.testcontainers</groupId>
+            <artifactId>junit-jupiter</artifactId>
+            <version>${testcontainers.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.testcontainers</groupId>
+            <artifactId>mariadb</artifactId>
+            <version>${testcontainers.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.testcontainers</groupId>
+            <artifactId>rabbitmq</artifactId>
+            <version>${testcontainers.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.opensearch</groupId>
+            <artifactId>opensearch-testcontainers</artifactId>
+            <version>${opensearch-testcontainer.version}</version>
             <scope>test</scope>
         </dependency>
         <dependency>
diff --git a/dbrepo-query-service/rest-service/src/main/java/at/tuwien/endpoint/ExportEndpoint.java b/dbrepo-query-service/rest-service/src/main/java/at/tuwien/endpoint/ExportEndpoint.java
index d052feb732..60b0aea9fa 100644
--- a/dbrepo-query-service/rest-service/src/main/java/at/tuwien/endpoint/ExportEndpoint.java
+++ b/dbrepo-query-service/rest-service/src/main/java/at/tuwien/endpoint/ExportEndpoint.java
@@ -4,10 +4,12 @@ import at.tuwien.ExportResource;
 import at.tuwien.entities.database.Database;
 import at.tuwien.entities.user.User;
 import at.tuwien.exception.*;
-import at.tuwien.service.*;
+import at.tuwien.service.DatabaseService;
+import at.tuwien.service.QueryService;
 import io.micrometer.core.annotation.Timed;
 import io.swagger.v3.oas.annotations.Operation;
 import io.swagger.v3.oas.annotations.security.SecurityRequirement;
+import jakarta.validation.constraints.NotNull;
 import lombok.extern.log4j.Log4j2;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.core.io.InputStreamResource;
@@ -16,14 +18,13 @@ import org.springframework.http.ResponseEntity;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.*;
 
-import jakarta.validation.constraints.NotNull;
 import java.security.Principal;
 import java.time.Instant;
 
 @Log4j2
 @CrossOrigin(origins = "*")
 @RestController
-@RequestMapping("/api/container/{id}/database/{databaseId}/table/{tableId}/export")
+@RequestMapping("/api/database/{id}/table/{tableId}/export")
 public class ExportEndpoint {
 
     private final QueryService queryService;
@@ -39,17 +40,15 @@ public class ExportEndpoint {
     @Transactional(readOnly = true)
     @Timed(value = "table.export", description = "Time needed to export table data")
     @Operation(summary = "Export table", security = @SecurityRequirement(name = "bearerAuth"))
-    public ResponseEntity<InputStreamResource> export(@NotNull @PathVariable("id") Long containerId,
-                                                      @NotNull @PathVariable("databaseId") Long databaseId,
+    public ResponseEntity<InputStreamResource> export(@NotNull @PathVariable("id") Long databaseId,
                                                       @NotNull @PathVariable("tableId") Long tableId,
                                                       @RequestParam(required = false) Instant timestamp,
                                                       Principal principal)
             throws TableNotFoundException, DatabaseConnectionException, TableMalformedException,
             DatabaseNotFoundException, ImageNotSupportedException, PaginationException, ContainerNotFoundException,
             FileStorageException, QueryMalformedException, UserNotFoundException, NotAllowedException {
-        log.debug("endpoint export table, id={}, databaseId={}, tableId={}, timestamp={}, principal={}", containerId, databaseId,
-                tableId, timestamp, principal);
-        final Database database = databaseService.find(containerId, databaseId);
+        log.debug("endpoint export table, id={}, tableId={}, timestamp={}, principal={}", databaseId, tableId, timestamp, principal);
+        final Database database = databaseService.find(databaseId);
         if (!database.getIsPublic()) {
             if (principal == null) {
                 log.error("Failed to export private table: principal is null");
@@ -61,7 +60,7 @@ public class ExportEndpoint {
             }
         }
         final HttpHeaders headers = new HttpHeaders();
-        final ExportResource resource = queryService.tableFindAll(containerId, databaseId, tableId, timestamp, principal);
+        final ExportResource resource = queryService.tableFindAll(databaseId, tableId, timestamp, principal);
         headers.add("Content-Disposition", "attachment; filename=\"" + resource.getFilename() + "\"");
         log.trace("export table resulted in resource {}", resource);
         return ResponseEntity.ok()
diff --git a/dbrepo-query-service/rest-service/src/main/java/at/tuwien/endpoint/QueryEndpoint.java b/dbrepo-query-service/rest-service/src/main/java/at/tuwien/endpoint/QueryEndpoint.java
index 6224be726b..a72681599b 100644
--- a/dbrepo-query-service/rest-service/src/main/java/at/tuwien/endpoint/QueryEndpoint.java
+++ b/dbrepo-query-service/rest-service/src/main/java/at/tuwien/endpoint/QueryEndpoint.java
@@ -2,16 +2,22 @@ package at.tuwien.endpoint;
 
 import at.tuwien.ExportResource;
 import at.tuwien.SortType;
-import at.tuwien.api.database.query.*;
+import at.tuwien.api.database.query.ExecuteStatementDto;
+import at.tuwien.api.database.query.QueryResultDto;
 import at.tuwien.entities.database.Database;
 import at.tuwien.entities.user.User;
-import at.tuwien.querystore.Query;
 import at.tuwien.exception.*;
-import at.tuwien.service.*;
+import at.tuwien.querystore.Query;
+import at.tuwien.service.AccessService;
+import at.tuwien.service.DatabaseService;
+import at.tuwien.service.QueryService;
+import at.tuwien.service.StoreService;
 import at.tuwien.validation.EndpointValidator;
 import io.micrometer.core.annotation.Timed;
 import io.swagger.v3.oas.annotations.Operation;
 import io.swagger.v3.oas.annotations.security.SecurityRequirement;
+import jakarta.validation.Valid;
+import jakarta.validation.constraints.NotNull;
 import lombok.extern.log4j.Log4j2;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpHeaders;
@@ -21,14 +27,12 @@ import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.*;
 
-import jakarta.validation.Valid;
-import jakarta.validation.constraints.NotNull;
 import java.security.Principal;
 
 
 @Log4j2
 @RestController
-@RequestMapping("/api/container/{id}/database/{databaseId}/query")
+@RequestMapping("/api/database/{databaseId}/query")
 public class QueryEndpoint {
 
     private final QueryService queryService;
@@ -52,8 +56,7 @@ public class QueryEndpoint {
     @Timed(value = "query.execute", description = "Time needed to execute a query")
     @PreAuthorize("hasAuthority('execute-query')")
     @Operation(summary = "Execute query", security = @SecurityRequirement(name = "bearerAuth"))
-    public ResponseEntity<QueryResultDto> execute(@NotNull @PathVariable("id") Long containerId,
-                                                  @NotNull @PathVariable("databaseId") Long databaseId,
+    public ResponseEntity<QueryResultDto> execute(@NotNull @PathVariable("databaseId") Long databaseId,
                                                   @NotNull @Valid @RequestBody ExecuteStatementDto data,
                                                   @RequestParam(value = "page", required = false) Long page,
                                                   @RequestParam(value = "size", required = false) Long size,
@@ -63,8 +66,8 @@ public class QueryEndpoint {
             throws DatabaseNotFoundException, ImageNotSupportedException, QueryStoreException, QueryMalformedException,
             ContainerNotFoundException, ColumnParseException, UserNotFoundException, TableMalformedException,
             DatabaseConnectionException, SortException, PaginationException, NotAllowedException {
-        log.debug("endpoint execute query, containerId={}, databaseId={}, data={}, page={}, size={}, principal={}, sortDirection={}, sortColumn={}",
-                containerId, databaseId, data, page, size, principal, sortDirection, sortColumn);
+        log.debug("endpoint execute query, databaseId={}, data={}, page={}, size={}, principal={}, sortDirection={}, sortColumn={}",
+                databaseId, data, page, size, principal, sortDirection, sortColumn);
         /* check */
         if (data.getStatement() == null || data.getStatement().isBlank()) {
             log.error("Failed to execute empty query");
@@ -75,7 +78,7 @@ public class QueryEndpoint {
         /* has access */
         accessService.find(databaseId, principal.getName());
         /* execute */
-        final QueryResultDto result = queryService.execute(containerId, databaseId, data, principal, page, size,
+        final QueryResultDto result = queryService.execute(databaseId, data, principal, page, size,
                 sortDirection, sortColumn);
         log.trace("execute query resulted in result {}", result);
         return ResponseEntity.status(HttpStatus.ACCEPTED)
@@ -86,8 +89,7 @@ public class QueryEndpoint {
     @Transactional(readOnly = true)
     @Timed(value = "query.reexecute", description = "Time needed to re-execute a query")
     @Operation(summary = "Re-execute some query", security = @SecurityRequirement(name = "bearerAuth"))
-    public ResponseEntity<QueryResultDto> reExecute(@NotNull @PathVariable("id") Long containerId,
-                                                    @NotNull @PathVariable("databaseId") Long databaseId,
+    public ResponseEntity<QueryResultDto> reExecute(@NotNull @PathVariable("databaseId") Long databaseId,
                                                     @NotNull @PathVariable("queryId") Long queryId,
                                                     Principal principal,
                                                     @RequestParam(value = "page", required = false) Long page,
@@ -97,10 +99,10 @@ public class QueryEndpoint {
             throws QueryStoreException, QueryNotFoundException, DatabaseNotFoundException, ImageNotSupportedException,
             QueryMalformedException, TableMalformedException, ColumnParseException,
             DatabaseConnectionException, SortException, PaginationException, UserNotFoundException, NotAllowedException {
-        log.debug("endpoint re-execute query, containerId={}, databaseId={}, queryId={}, principal={}, page={}, size={}, sortDirection={}, sortColumn={}",
-                containerId, databaseId, queryId, principal, page, size, sortDirection, sortColumn);
+        log.debug("endpoint re-execute query, databaseId={}, queryId={}, principal={}, page={}, size={}, sortDirection={}, sortColumn={}",
+                databaseId, queryId, principal, page, size, sortDirection, sortColumn);
         endpointValidator.validateDataParams(page, size, sortDirection, sortColumn);
-        final Database database = databaseService.find(containerId, databaseId);
+        final Database database = databaseService.find(databaseId);
         if (!database.getIsPublic()) {
             if (principal == null) {
                 log.error("Failed to re-execute private query: principal is null");
@@ -112,8 +114,8 @@ public class QueryEndpoint {
             }
         }
         /* execute */
-        final Query query = storeService.findOne(containerId, databaseId, queryId, principal);
-        final QueryResultDto result = queryService.reExecute(containerId, databaseId, query, page, size,
+        final Query query = storeService.findOne(databaseId, queryId, principal);
+        final QueryResultDto result = queryService.reExecute(databaseId, query, page, size,
                 sortDirection, sortColumn, principal);
         result.setId(queryId);
         log.trace("re-execute query resulted in result {}", result);
@@ -125,16 +127,15 @@ public class QueryEndpoint {
     @Transactional(readOnly = true)
     @Timed(value = "query.reexecute.count", description = "Time needed to re-execute a query")
     @Operation(summary = "Re-execute some query", security = @SecurityRequirement(name = "bearerAuth"))
-    public ResponseEntity<Long> reExecuteCount(@NotNull @PathVariable("id") Long containerId,
-                                               @NotNull @PathVariable("databaseId") Long databaseId,
+    public ResponseEntity<Long> reExecuteCount(@NotNull @PathVariable("databaseId") Long databaseId,
                                                @NotNull @PathVariable("queryId") Long queryId,
                                                Principal principal)
             throws QueryStoreException, QueryNotFoundException, DatabaseNotFoundException, ImageNotSupportedException,
             QueryMalformedException, TableMalformedException, ColumnParseException, NotAllowedException,
             DatabaseConnectionException, UserNotFoundException {
-        log.debug("endpoint re-execute query count, containerId={}, databaseId={}, queryId={}, principal={}",
-                containerId, databaseId, queryId, principal);
-        final Database database = databaseService.find(containerId, databaseId);
+        log.debug("endpoint re-execute query count, databaseId={}, queryId={}, principal={}",
+                databaseId, queryId, principal);
+        final Database database = databaseService.find(databaseId);
         if (!database.getIsPublic()) {
             if (principal == null) {
                 log.error("Failed to re-execute private query: principal is null");
@@ -146,8 +147,8 @@ public class QueryEndpoint {
             }
         }
         /* execute */
-        final Query query = storeService.findOne(containerId, databaseId, queryId, principal);
-        final Long result = queryService.reExecuteCount(containerId, databaseId, query, principal);
+        final Query query = storeService.findOne(databaseId, queryId, principal);
+        final Long result = queryService.reExecuteCount(databaseId, query, principal);
         log.trace("re-execute query count resulted in result {}", result);
         return ResponseEntity.status(HttpStatus.ACCEPTED)
                 .body(result);
@@ -157,17 +158,16 @@ public class QueryEndpoint {
     @Transactional(readOnly = true)
     @Timed(value = "query.export", description = "Time needed to export query data")
     @Operation(summary = "Exports some query", security = @SecurityRequirement(name = "bearerAuth"))
-    public ResponseEntity<?> export(@NotNull @PathVariable("id") Long containerId,
-                                    @NotNull @PathVariable("databaseId") Long databaseId,
+    public ResponseEntity<?> export(@NotNull @PathVariable("databaseId") Long databaseId,
                                     @NotNull @PathVariable("queryId") Long queryId,
                                     @RequestHeader(HttpHeaders.ACCEPT) String accept,
                                     Principal principal)
             throws QueryStoreException, QueryNotFoundException, DatabaseNotFoundException, ImageNotSupportedException,
             ContainerNotFoundException, TableMalformedException, FileStorageException, QueryMalformedException,
             DatabaseConnectionException, UserNotFoundException, NotAllowedException {
-        log.debug("endpoint export query, containerId={}, databaseId={}, queryId={}, accept={}, principal={}",
-                containerId, databaseId, queryId, accept, principal);
-        final Database database = databaseService.find(containerId, databaseId);
+        log.debug("endpoint export query, databaseId={}, queryId={}, accept={}, principal={}",
+                databaseId, queryId, accept, principal);
+        final Database database = databaseService.find(databaseId);
         if (!database.getIsPublic()) {
             if (principal == null) {
                 log.error("Failed to export private query: principal is null");
@@ -178,9 +178,9 @@ public class QueryEndpoint {
                 throw new NotAllowedException("Failed to export private query: role missing");
             }
         }
-        final Query query = storeService.findOne(containerId, databaseId, queryId, principal);
+        final Query query = storeService.findOne(databaseId, queryId, principal);
         log.trace("query store returned query {}", query);
-        final ExportResource resource = queryService.findOne(containerId, databaseId, queryId, principal);
+        final ExportResource resource = queryService.findOne(databaseId, queryId, principal);
         if (accept == null || accept.equals("text/csv")) {
             final HttpHeaders headers = new HttpHeaders();
             headers.add("Content-Disposition", "attachment; filename=\"" + resource.getFilename() + "\"");
diff --git a/dbrepo-query-service/rest-service/src/main/java/at/tuwien/endpoint/StoreEndpoint.java b/dbrepo-query-service/rest-service/src/main/java/at/tuwien/endpoint/StoreEndpoint.java
index 9b043f3ea9..a3f78915ea 100644
--- a/dbrepo-query-service/rest-service/src/main/java/at/tuwien/endpoint/StoreEndpoint.java
+++ b/dbrepo-query-service/rest-service/src/main/java/at/tuwien/endpoint/StoreEndpoint.java
@@ -2,17 +2,19 @@ package at.tuwien.endpoint;
 
 import at.tuwien.api.database.query.QueryBriefDto;
 import at.tuwien.api.database.query.QueryDto;
-import at.tuwien.api.database.table.TableBriefDto;
 import at.tuwien.api.error.ApiErrorDto;
 import at.tuwien.entities.identifier.Identifier;
 import at.tuwien.entities.identifier.IdentifierType;
 import at.tuwien.entities.user.User;
+import at.tuwien.exception.*;
 import at.tuwien.mapper.IdentifierMapper;
+import at.tuwien.mapper.QueryMapper;
 import at.tuwien.mapper.UserMapper;
 import at.tuwien.querystore.Query;
-import at.tuwien.exception.*;
-import at.tuwien.mapper.QueryMapper;
-import at.tuwien.service.*;
+import at.tuwien.service.AccessService;
+import at.tuwien.service.IdentifierService;
+import at.tuwien.service.StoreService;
+import at.tuwien.service.UserService;
 import at.tuwien.validation.EndpointValidator;
 import io.micrometer.core.annotation.Timed;
 import io.swagger.v3.oas.annotations.Operation;
@@ -22,6 +24,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
 import io.swagger.v3.oas.annotations.responses.ApiResponse;
 import io.swagger.v3.oas.annotations.responses.ApiResponses;
 import io.swagger.v3.oas.annotations.security.SecurityRequirement;
+import jakarta.validation.constraints.NotNull;
 import lombok.extern.log4j.Log4j2;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpStatus;
@@ -30,7 +33,6 @@ import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.*;
 
-import jakarta.validation.constraints.NotNull;
 import java.security.Principal;
 import java.util.List;
 import java.util.Optional;
@@ -38,7 +40,7 @@ import java.util.stream.Collectors;
 
 @Log4j2
 @RestController
-@RequestMapping("/api/container/{id}/database/{databaseId}/query")
+@RequestMapping("/api/database/{databaseId}/query")
 public class StoreEndpoint {
 
     private final UserMapper userMapper;
@@ -105,16 +107,15 @@ public class StoreEndpoint {
                             mediaType = "application/json",
                             schema = @Schema(implementation = ApiErrorDto.class))}),
     })
-    public ResponseEntity<List<QueryBriefDto>> findAll(@NotNull @PathVariable("id") Long containerId,
-                                                       @NotNull @PathVariable("databaseId") Long databaseId,
+    public ResponseEntity<List<QueryBriefDto>> findAll(@NotNull @PathVariable("databaseId") Long databaseId,
                                                        @RequestParam(value = "persisted", required = false) Boolean persisted,
                                                        Principal principal) throws QueryStoreException,
             DatabaseNotFoundException, ImageNotSupportedException, ContainerNotFoundException,
             DatabaseConnectionException, TableMalformedException, UserNotFoundException, NotAllowedException {
-        log.debug("endpoint list queries, containerId={}, databaseId={}, persisted={}, principal={}", containerId,
+        log.debug("endpoint list queries, databaseId={}, persisted={}, principal={}",
                 databaseId, persisted, principal);
-        endpointValidator.validateOnlyAccessOrPublic(containerId, databaseId, principal);
-        final List<Query> queries = storeService.findAll(containerId, databaseId, persisted, principal);
+        endpointValidator.validateOnlyAccessOrPublic(databaseId, principal);
+        final List<Query> queries = storeService.findAll(databaseId, persisted, principal);
         final List<Identifier> identifiers = identifierService.findAll();
         final List<User> users = userService.findAll();
         final List<QueryBriefDto> dto = queries.stream()
@@ -171,19 +172,18 @@ public class StoreEndpoint {
                             mediaType = "application/json",
                             schema = @Schema(implementation = ApiErrorDto.class))}),
     })
-    public ResponseEntity<QueryDto> find(@NotNull @PathVariable("id") Long containerId,
-                                         @NotNull @PathVariable("databaseId") Long databaseId,
+    public ResponseEntity<QueryDto> find(@NotNull @PathVariable("databaseId") Long databaseId,
                                          @NotNull @PathVariable Long queryId,
                                          Principal principal)
             throws DatabaseNotFoundException, ImageNotSupportedException,
             QueryStoreException, QueryNotFoundException, UserNotFoundException, NotAllowedException,
             DatabaseConnectionException {
-        log.debug("endpoint find query, containerId={}, databaseId={}, queryId={}, principal={}", containerId, databaseId,
+        log.debug("endpoint find query, databaseId={}, queryId={}, principal={}", databaseId,
                 queryId, principal);
         /* check */
-        endpointValidator.validateOnlyAccessOrPublic(containerId, databaseId, principal);
+        endpointValidator.validateOnlyAccessOrPublic(databaseId, principal);
         /* find */
-        final Query query = storeService.findOne(containerId, databaseId, queryId, principal);
+        final Query query = storeService.findOne(databaseId, queryId, principal);
         final QueryDto dto = queryMapper.queryToQueryDto(query);
         final User creator = userService.findByUsername(query.getCreatedBy());
         dto.setCreator(userMapper.userToUserDto(creator));
@@ -234,18 +234,17 @@ public class StoreEndpoint {
                             mediaType = "application/json",
                             schema = @Schema(implementation = ApiErrorDto.class))}),
     })
-    public ResponseEntity<QueryDto> persist(@NotNull @PathVariable("id") Long containerId,
-                                            @NotNull @PathVariable("databaseId") Long databaseId,
+    public ResponseEntity<QueryDto> persist(@NotNull @PathVariable("databaseId") Long databaseId,
                                             @NotNull @PathVariable("queryId") Long queryId,
                                             @NotNull Principal principal)
             throws QueryStoreException, DatabaseNotFoundException, ImageNotSupportedException,
             DatabaseConnectionException, UserNotFoundException, QueryNotFoundException,
             QueryAlreadyPersistedException, NotAllowedException {
-        log.debug("endpoint persist query, container, containerId={}, databaseId={}, queryId={}, principal={}",
-                containerId, databaseId, queryId, principal);
+        log.debug("endpoint persist query, container, databaseId={}, queryId={}, principal={}",
+                databaseId, queryId, principal);
         /* check */
-        endpointValidator.validateOnlyAccessOrPublic(containerId, databaseId, principal);
-        final Query check = storeService.findOne(containerId, databaseId, queryId, principal);
+        endpointValidator.validateOnlyAccessOrPublic(databaseId, principal);
+        final Query check = storeService.findOne(databaseId, queryId, principal);
         if (!check.getCreatedBy().equals(principal.getName())) {
             log.error("Cannot persist foreign query: created by {}", check.getCreatedBy());
             throw new NotAllowedException("Cannot persist foreign query: created by " + check.getCreatedBy());
@@ -257,7 +256,7 @@ public class StoreEndpoint {
         /* has access */
         accessService.find(databaseId, principal.getName());
         /* persist */
-        final Query query = storeService.persist(containerId, databaseId, queryId, principal);
+        final Query query = storeService.persist(databaseId, queryId, principal);
         final QueryDto dto = queryMapper.queryToQueryDto(query);
         final User creator = userService.findByUsername(query.getCreatedBy());
         dto.setCreator(userMapper.userToUserDto(creator));
diff --git a/dbrepo-query-service/rest-service/src/main/java/at/tuwien/endpoint/TableDataEndpoint.java b/dbrepo-query-service/rest-service/src/main/java/at/tuwien/endpoint/TableDataEndpoint.java
index e0ad8ea8d8..758ab3be32 100644
--- a/dbrepo-query-service/rest-service/src/main/java/at/tuwien/endpoint/TableDataEndpoint.java
+++ b/dbrepo-query-service/rest-service/src/main/java/at/tuwien/endpoint/TableDataEndpoint.java
@@ -9,11 +9,14 @@ import at.tuwien.api.database.table.TableCsvUpdateDto;
 import at.tuwien.entities.database.Database;
 import at.tuwien.entities.user.User;
 import at.tuwien.exception.*;
-import at.tuwien.service.*;
+import at.tuwien.service.DatabaseService;
+import at.tuwien.service.QueryService;
 import at.tuwien.validation.EndpointValidator;
 import io.micrometer.core.annotation.Timed;
 import io.swagger.v3.oas.annotations.Operation;
 import io.swagger.v3.oas.annotations.security.SecurityRequirement;
+import jakarta.validation.Valid;
+import jakarta.validation.constraints.NotNull;
 import lombok.extern.log4j.Log4j2;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.ResponseEntity;
@@ -21,15 +24,13 @@ import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.*;
 
-import jakarta.validation.Valid;
-import jakarta.validation.constraints.NotNull;
 import java.security.Principal;
 import java.time.Instant;
 
 @Log4j2
 @CrossOrigin(origins = "*")
 @RestController
-@RequestMapping("/api/container/{id}/database/{databaseId}/table/{tableId}/data")
+@RequestMapping("/api/database/{databaseId}/table/{tableId}/data")
 public class TableDataEndpoint {
 
     private final QueryService queryService;
@@ -49,20 +50,19 @@ public class TableDataEndpoint {
     @Timed(value = "data.insert", description = "Time needed to insert data into a table")
     @PreAuthorize("hasAuthority('insert-table-data')")
     @Operation(summary = "Insert data", security = @SecurityRequirement(name = "bearerAuth"))
-    public ResponseEntity<Void> insert(@NotNull @PathVariable("id") Long containerId,
-                                       @NotNull @PathVariable("databaseId") Long databaseId,
+    public ResponseEntity<Void> insert(@NotNull @PathVariable("databaseId") Long databaseId,
                                        @NotNull @PathVariable("tableId") Long tableId,
                                        @NotNull @Valid @RequestBody TableCsvDto data,
                                        @NotNull Principal principal)
             throws TableNotFoundException, DatabaseNotFoundException, TableMalformedException,
             ImageNotSupportedException, ContainerNotFoundException, DatabaseConnectionException,
             UserNotFoundException, NotAllowedException {
-        log.debug("endpoint insert data, containerId={}, databaseId={}, tableId={}, data={}, principal={}", containerId,
+        log.debug("endpoint insert data, databaseId={}, tableId={}, data={}, principal={}",
                 databaseId, tableId, data, principal);
         /* check */
-        endpointValidator.validateOnlyWriteOwnOrWriteAllAccess(containerId, databaseId, tableId, principal);
+        endpointValidator.validateOnlyWriteOwnOrWriteAllAccess(databaseId, tableId, principal);
         /* insert */
-        queryService.insert(containerId, databaseId, tableId, data, principal);
+        queryService.insert(databaseId, tableId, data, principal);
         return ResponseEntity.accepted()
                 .build();
     }
@@ -73,20 +73,19 @@ public class TableDataEndpoint {
     @PreAuthorize("hasAuthority('insert-table-data')")
     @Timed(value = "data.update", description = "Time needed to update data in a table")
     @Operation(summary = "Update data", security = @SecurityRequirement(name = "bearerAuth"))
-    public ResponseEntity<Void> update(@NotNull @PathVariable("id") Long containerId,
-                                       @NotNull @PathVariable("databaseId") Long databaseId,
+    public ResponseEntity<Void> update(@NotNull @PathVariable("databaseId") Long databaseId,
                                        @NotNull @PathVariable("tableId") Long tableId,
                                        @NotNull @Valid @RequestBody TableCsvUpdateDto data,
                                        @NotNull Principal principal)
             throws TableNotFoundException, DatabaseNotFoundException, TableMalformedException,
             ImageNotSupportedException, DatabaseConnectionException, QueryMalformedException,
             UserNotFoundException, NotAllowedException {
-        log.debug("endpoint update data, containerId={}, databaseId={}, tableId={}, data={}, principal={}", containerId,
+        log.debug("endpoint update data, databaseId={}, tableId={}, data={}, principal={}",
                 databaseId, tableId, data, principal);
         /* check */
-        endpointValidator.validateOnlyWriteOwnOrWriteAllAccess(containerId, databaseId, tableId, principal);
+        endpointValidator.validateOnlyWriteOwnOrWriteAllAccess(databaseId, tableId, principal);
         /* update */
-        queryService.update(containerId, databaseId, tableId, data, principal);
+        queryService.update(databaseId, tableId, data, principal);
         return ResponseEntity.accepted()
                 .build();
     }
@@ -96,20 +95,19 @@ public class TableDataEndpoint {
     @PreAuthorize("hasAuthority('delete-table-data')")
     @Timed(value = "data.delete", description = "Time needed to delete data into a table")
     @Operation(summary = "Delete data", security = @SecurityRequirement(name = "bearerAuth"))
-    public ResponseEntity<Void> delete(@NotNull @PathVariable("id") Long containerId,
-                                       @NotNull @PathVariable("databaseId") Long databaseId,
+    public ResponseEntity<Void> delete(@NotNull @PathVariable("databaseId") Long databaseId,
                                        @NotNull @PathVariable("tableId") Long tableId,
                                        @NotNull @Valid @RequestBody TableCsvDeleteDto data,
                                        @NotNull Principal principal)
             throws TableNotFoundException, DatabaseNotFoundException, TableMalformedException,
             ImageNotSupportedException, ContainerNotFoundException,
             DatabaseConnectionException, QueryMalformedException, UserNotFoundException, NotAllowedException {
-        log.debug("endpoint delete data, containerId={}, databaseId={}, tableId={}, data={}, principal={}", containerId,
+        log.debug("endpoint delete data, databaseId={}, tableId={}, data={}, principal={}",
                 databaseId, tableId, data, principal);
         /* check */
-        endpointValidator.validateOnlyWriteOwnOrWriteAllAccess(containerId, databaseId, tableId, principal);
+        endpointValidator.validateOnlyWriteOwnOrWriteAllAccess(databaseId, tableId, principal);
         /* delete */
-        queryService.delete(containerId, databaseId, tableId, data, principal);
+        queryService.delete(databaseId, tableId, data, principal);
         return ResponseEntity.accepted()
                 .build();
     }
@@ -119,20 +117,19 @@ public class TableDataEndpoint {
     @PreAuthorize("hasAuthority('insert-table-data')")
     @Timed(value = "data.insertbulk", description = "Time needed to insert data from .csv into a table")
     @Operation(summary = "Insert data from csv", security = @SecurityRequirement(name = "bearerAuth"))
-    public ResponseEntity<Void> importCsv(@NotNull @PathVariable("id") Long containerId,
-                                          @NotNull @PathVariable("databaseId") Long databaseId,
+    public ResponseEntity<Void> importCsv(@NotNull @PathVariable("databaseId") Long databaseId,
                                           @NotNull @PathVariable("tableId") Long tableId,
                                           @NotNull @Valid @RequestBody ImportDto data,
                                           @NotNull Principal principal)
             throws TableNotFoundException, DatabaseNotFoundException, TableMalformedException,
             ImageNotSupportedException, ContainerNotFoundException, DatabaseConnectionException,
             QueryMalformedException, UserNotFoundException, NotAllowedException {
-        log.debug("endpoint insert data from csv, containerId={}, databaseId={}, tableId={}, data={}, principal={}",
-                containerId, databaseId, tableId, data, principal);
+        log.debug("endpoint insert data from csv, databaseId={}, tableId={}, data={}, principal={}",
+                databaseId, tableId, data, principal);
         /* check */
-        endpointValidator.validateOnlyWriteOwnOrWriteAllAccess(containerId, databaseId, tableId, principal);
+        endpointValidator.validateOnlyWriteOwnOrWriteAllAccess(databaseId, tableId, principal);
         /* insert */
-        queryService.insert(containerId, databaseId, tableId, data, principal);
+        queryService.insert(databaseId, tableId, data, principal);
         return ResponseEntity.accepted()
                 .build();
     }
@@ -141,8 +138,7 @@ public class TableDataEndpoint {
     @Transactional(readOnly = true)
     @Timed(value = "data.all", description = "Time needed to find all data from a table")
     @Operation(summary = "Find data", security = @SecurityRequirement(name = "bearerAuth"))
-    public ResponseEntity<QueryResultDto> getAll(@NotNull @PathVariable("id") Long containerId,
-                                                 @NotNull @PathVariable("databaseId") Long databaseId,
+    public ResponseEntity<QueryResultDto> getAll(@NotNull @PathVariable("databaseId") Long databaseId,
                                                  @NotNull @PathVariable("tableId") Long tableId,
                                                  @NotNull Principal principal,
                                                  @RequestParam(required = false) Instant timestamp,
@@ -153,18 +149,18 @@ public class TableDataEndpoint {
             throws TableNotFoundException, DatabaseNotFoundException, DatabaseConnectionException,
             ImageNotSupportedException, TableMalformedException, PaginationException, ContainerNotFoundException,
             QueryMalformedException, UserNotFoundException, SortException, NotAllowedException {
-        log.debug("endpoint find table data, containerId={}, databaseId={}, tableId={}, principal={}, timestamp={}, page={}, size={}, sortDirection={}, sortColumn={}",
-                containerId, databaseId, tableId, principal, timestamp, page, size, sortDirection, sortColumn);
+        log.debug("endpoint find table data, databaseId={}, tableId={}, principal={}, timestamp={}, page={}, size={}, sortDirection={}, sortColumn={}",
+                databaseId, tableId, principal, timestamp, page, size, sortDirection, sortColumn);
         /* check */
         endpointValidator.validateDataParams(page, size, sortDirection, sortColumn);
-        endpointValidator.validateOnlyAccessOrPublic(containerId, databaseId, principal);
-        final Database database = databaseService.find(containerId, databaseId);
+        endpointValidator.validateOnlyAccessOrPublic(databaseId, principal);
+        final Database database = databaseService.find(databaseId);
         if (!database.getIsPublic() && !User.hasRole(principal, "view-table-data")) {
             log.error("Failed to view table data: database with id {} is private and user has no authority", databaseId);
             throw new NotAllowedException("Failed to view table data: database with id " + databaseId + " is private and user has no authority");
         }
         /* find */
-        final QueryResultDto response = queryService.tableFindAll(containerId, databaseId, tableId, timestamp, page, size, principal);
+        final QueryResultDto response = queryService.tableFindAll(databaseId, tableId, timestamp, page, size, principal);
         log.trace("find table data resulted in result {}", response);
         return ResponseEntity.ok()
                 .body(response);
@@ -174,25 +170,24 @@ public class TableDataEndpoint {
     @Transactional(readOnly = true)
     @Timed(value = "data.all.count", description = "Time needed to get count of all data from a table")
     @Operation(summary = "Find data", security = @SecurityRequirement(name = "bearerAuth"))
-    public ResponseEntity<Long> getCount(@NotNull @PathVariable("id") Long containerId,
-                                         @NotNull @PathVariable("databaseId") Long databaseId,
+    public ResponseEntity<Long> getCount(@NotNull @PathVariable("databaseId") Long databaseId,
                                          @NotNull @PathVariable("tableId") Long tableId,
                                          @NotNull Principal principal,
                                          @RequestParam(required = false) Instant timestamp)
             throws TableNotFoundException, DatabaseNotFoundException, DatabaseConnectionException,
             ImageNotSupportedException, TableMalformedException, ContainerNotFoundException,
             QueryStoreException, QueryMalformedException, UserNotFoundException, NotAllowedException {
-        log.debug("endpoint find table data, containerId={}, databaseId={}, tableId={}, principal={}, timestamp={}",
-                containerId, databaseId, tableId, principal, timestamp);
+        log.debug("endpoint find table data, databaseId={}, tableId={}, principal={}, timestamp={}",
+                databaseId, tableId, principal, timestamp);
         /* check */
-        endpointValidator.validateOnlyAccessOrPublic(containerId, databaseId, principal);
-        final Database database = databaseService.find(containerId, databaseId);
+        endpointValidator.validateOnlyAccessOrPublic(databaseId, principal);
+        final Database database = databaseService.find(databaseId);
         if (!database.getIsPublic() && !User.hasRole(principal, "view-table-data")) {
             log.error("Failed to view table data: database with id {} is private and user has no authority", databaseId);
             throw new NotAllowedException("Failed to view table data: database with id " + databaseId + " is private and user has no authority");
         }
         /* find */
-        final Long count = queryService.tableCount(containerId, databaseId, tableId, timestamp, principal);
+        final Long count = queryService.tableCount(databaseId, tableId, timestamp, principal);
         log.debug("table data count is {} tuples", count);
         return ResponseEntity.ok()
                 .body(count);
diff --git a/dbrepo-query-service/rest-service/src/main/java/at/tuwien/endpoint/TableHistoryEndpoint.java b/dbrepo-query-service/rest-service/src/main/java/at/tuwien/endpoint/TableHistoryEndpoint.java
index f0d05319d3..05cf4553c7 100644
--- a/dbrepo-query-service/rest-service/src/main/java/at/tuwien/endpoint/TableHistoryEndpoint.java
+++ b/dbrepo-query-service/rest-service/src/main/java/at/tuwien/endpoint/TableHistoryEndpoint.java
@@ -1,10 +1,9 @@
 package at.tuwien.endpoint;
 
-import at.tuwien.api.database.table.TableBriefDto;
 import at.tuwien.api.database.table.TableHistoryDto;
 import at.tuwien.api.error.ApiErrorDto;
 import at.tuwien.exception.*;
-import at.tuwien.service.*;
+import at.tuwien.service.TableService;
 import io.micrometer.core.annotation.Timed;
 import io.swagger.v3.oas.annotations.Operation;
 import io.swagger.v3.oas.annotations.media.ArraySchema;
@@ -13,20 +12,20 @@ import io.swagger.v3.oas.annotations.media.Schema;
 import io.swagger.v3.oas.annotations.responses.ApiResponse;
 import io.swagger.v3.oas.annotations.responses.ApiResponses;
 import io.swagger.v3.oas.annotations.security.SecurityRequirement;
+import jakarta.validation.constraints.NotNull;
 import lombok.extern.log4j.Log4j2;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.ResponseEntity;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.*;
 
-import jakarta.validation.constraints.NotNull;
 import java.security.Principal;
 import java.util.List;
 
 @Log4j2
 @CrossOrigin(origins = "*")
 @RestController
-@RequestMapping("/api/container/{id}/database/{databaseId}/table/{tableId}/history")
+@RequestMapping("/api/database/{databaseId}/table/{tableId}/history")
 public class TableHistoryEndpoint {
 
     private final TableService tableService;
@@ -72,15 +71,14 @@ public class TableHistoryEndpoint {
                             mediaType = "application/json",
                             schema = @Schema(implementation = ApiErrorDto.class))}),
     })
-    public ResponseEntity<List<TableHistoryDto>> getAll(@NotNull @PathVariable("id") Long containerId,
-                                                        @NotNull @PathVariable("databaseId") Long databaseId,
+    public ResponseEntity<List<TableHistoryDto>> getAll(@NotNull @PathVariable("databaseId") Long databaseId,
                                                         @NotNull @PathVariable("tableId") Long tableId,
                                                         @NotNull Principal principal)
             throws TableNotFoundException, QueryMalformedException, DatabaseNotFoundException,
             QueryStoreException, DatabaseConnectionException, UserNotFoundException {
-        log.debug("endpoint find all history, containerId={}, databaseid={}, tableId={}, principal={}", containerId,
+        log.debug("endpoint find all history, databaseid={}, tableId={}, principal={}",
                 databaseId, tableId, principal);
-        final List<TableHistoryDto> history = tableService.findHistory(containerId, databaseId, tableId, principal);
+        final List<TableHistoryDto> history = tableService.findHistory(databaseId, tableId, principal);
         log.trace("find all history resulted in history {}", history);
         return ResponseEntity.ok(history);
     }
diff --git a/dbrepo-query-service/rest-service/src/main/java/at/tuwien/endpoint/ViewEndpoint.java b/dbrepo-query-service/rest-service/src/main/java/at/tuwien/endpoint/ViewEndpoint.java
index a1149174e4..f52197744a 100644
--- a/dbrepo-query-service/rest-service/src/main/java/at/tuwien/endpoint/ViewEndpoint.java
+++ b/dbrepo-query-service/rest-service/src/main/java/at/tuwien/endpoint/ViewEndpoint.java
@@ -4,14 +4,15 @@ import at.tuwien.api.database.ViewBriefDto;
 import at.tuwien.api.database.ViewCreateDto;
 import at.tuwien.api.database.ViewDto;
 import at.tuwien.api.database.query.QueryResultDto;
-import at.tuwien.api.database.table.TableBriefDto;
 import at.tuwien.api.error.ApiErrorDto;
 import at.tuwien.entities.database.Database;
 import at.tuwien.entities.database.View;
 import at.tuwien.entities.user.User;
 import at.tuwien.exception.*;
 import at.tuwien.mapper.ViewMapper;
-import at.tuwien.service.*;
+import at.tuwien.service.DatabaseService;
+import at.tuwien.service.QueryService;
+import at.tuwien.service.ViewService;
 import at.tuwien.validation.EndpointValidator;
 import io.micrometer.core.annotation.Timed;
 import io.swagger.v3.oas.annotations.Operation;
@@ -21,6 +22,8 @@ import io.swagger.v3.oas.annotations.media.Schema;
 import io.swagger.v3.oas.annotations.responses.ApiResponse;
 import io.swagger.v3.oas.annotations.responses.ApiResponses;
 import io.swagger.v3.oas.annotations.security.SecurityRequirement;
+import jakarta.validation.Valid;
+import jakarta.validation.constraints.NotNull;
 import lombok.extern.log4j.Log4j2;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpStatus;
@@ -29,8 +32,6 @@ import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.*;
 
-import jakarta.validation.Valid;
-import jakarta.validation.constraints.NotNull;
 import java.security.Principal;
 import java.util.List;
 import java.util.stream.Collectors;
@@ -38,7 +39,7 @@ import java.util.stream.Collectors;
 @Log4j2
 @CrossOrigin(origins = "*")
 @RestController
-@RequestMapping("/api/container/{id}/database/{databaseId}/view")
+@RequestMapping("/api/database/{databaseId}/view")
 public class ViewEndpoint {
 
     private final ViewMapper viewMapper;
@@ -78,13 +79,12 @@ public class ViewEndpoint {
                             mediaType = "application/json",
                             schema = @Schema(implementation = ApiErrorDto.class))}),
     })
-    public ResponseEntity<List<ViewBriefDto>> findAll(@NotNull @PathVariable("id") Long containerId,
-                                                      @NotNull @PathVariable("databaseId") Long databaseId,
+    public ResponseEntity<List<ViewBriefDto>> findAll(@NotNull @PathVariable("databaseId") Long databaseId,
                                                       Principal principal) throws DatabaseNotFoundException,
             UserNotFoundException {
-        log.debug("endpoint find all views, containerId={}, databaseId={}, principal={}", containerId,
+        log.debug("endpoint find all views, databaseId={}, principal={}",
                 databaseId, principal);
-        final Database database = databaseService.find(containerId, databaseId);
+        final Database database = databaseService.find(databaseId);
         log.trace("find all views for database {}", database);
         final List<ViewBriefDto> views = viewService.findAll(databaseId, principal)
                 .stream()
@@ -141,23 +141,22 @@ public class ViewEndpoint {
                             mediaType = "application/json",
                             schema = @Schema(implementation = ApiErrorDto.class))}),
     })
-    public ResponseEntity<ViewBriefDto> create(@NotNull @PathVariable("id") Long containerId,
-                                               @NotNull @PathVariable("databaseId") Long databaseId,
+    public ResponseEntity<ViewBriefDto> create(@NotNull @PathVariable("databaseId") Long databaseId,
                                                @NotNull @Valid @RequestBody ViewCreateDto data,
                                                @NotNull Principal principal) throws DatabaseNotFoundException,
             NotAllowedException, DatabaseConnectionException, ViewMalformedException, QueryMalformedException,
             UserNotFoundException {
-        log.debug("endpoint create view, containerId={}, databaseId={}, data={}, principal={}", containerId,
+        log.debug("endpoint create view, databaseId={}, data={}, principal={}",
                 databaseId, data, principal);
         /* check */
-        final Database database = databaseService.find(containerId, databaseId);
+        final Database database = databaseService.find(databaseId);
         if (!database.getOwner().equalsPrincipal(principal)) {
             log.error("Failed to create view: not the database owner");
             throw new NotAllowedException("Failed to create view: not the database owner");
         }
         log.trace("create view for database {}", database);
         final View view;
-        view = viewService.create(containerId, databaseId, data, principal);
+        view = viewService.create(databaseId, data, principal);
         final ViewBriefDto dto = viewMapper.viewToViewBriefDto(view);
         log.trace("create view resulted in view {}", dto);
         return ResponseEntity.status(HttpStatus.CREATED)
@@ -185,14 +184,13 @@ public class ViewEndpoint {
                             mediaType = "application/json",
                             schema = @Schema(implementation = ApiErrorDto.class))}),
     })
-    public ResponseEntity<ViewDto> find(@NotNull @PathVariable("id") Long containerId,
-                                        @NotNull @PathVariable("databaseId") Long databaseId,
+    public ResponseEntity<ViewDto> find(@NotNull @PathVariable("databaseId") Long databaseId,
                                         @NotNull @PathVariable("viewId") Long viewId,
                                         Principal principal) throws DatabaseNotFoundException,
             NotAllowedException, ViewNotFoundException, UserNotFoundException {
-        log.debug("endpoint find view, containerId={}, databaseId={}, viewId={}, principal={}", containerId,
+        log.debug("endpoint find view, databaseId={}, viewId={}, principal={}",
                 databaseId, viewId, principal);
-        final Database database = databaseService.find(containerId, databaseId);
+        final Database database = databaseService.find(databaseId);
         log.trace("find view for database {}", database);
         final ViewDto view = viewMapper.viewToViewDto(viewService.findById(databaseId, viewId, principal));
         log.trace("find find resulted in view {}", view);
@@ -244,21 +242,20 @@ public class ViewEndpoint {
                             mediaType = "application/json",
                             schema = @Schema(implementation = ApiErrorDto.class))}),
     })
-    public ResponseEntity<?> delete(@NotNull @PathVariable("id") Long containerId,
-                                    @NotNull @PathVariable("databaseId") Long databaseId,
+    public ResponseEntity<?> delete(@NotNull @PathVariable("databaseId") Long databaseId,
                                     @NotNull @PathVariable("viewId") Long viewId,
                                     @NotNull Principal principal) throws DatabaseNotFoundException,
             ViewNotFoundException, UserNotFoundException, DatabaseConnectionException,
             ViewMalformedException, QueryMalformedException, NotAllowedException {
-        log.debug("endpoint delete view, containerId={}, databaseId={}, viewId={}, principal={}", containerId,
+        log.debug("endpoint delete view, databaseId={}, viewId={}, principal={}",
                 databaseId, viewId, principal);
         /* check */
-        final Database database = databaseService.find(containerId, databaseId);
+        final Database database = databaseService.find(databaseId);
         if (!database.getOwner().equalsPrincipal(principal)) {
             log.error("Failed to delete view: not the database owner");
             throw new NotAllowedException("Failed to delete view: not the database owner");
         }
-        viewService.delete(containerId, databaseId, viewId, principal);
+        viewService.delete(databaseId, viewId, principal);
         return ResponseEntity.accepted()
                 .build();
     }
@@ -324,8 +321,7 @@ public class ViewEndpoint {
                             mediaType = "application/json",
                             schema = @Schema(implementation = ApiErrorDto.class))}),
     })
-    public ResponseEntity<QueryResultDto> data(@NotNull @PathVariable("id") Long containerId,
-                                               @NotNull @PathVariable("databaseId") Long databaseId,
+    public ResponseEntity<QueryResultDto> data(@NotNull @PathVariable("databaseId") Long databaseId,
                                                @NotNull @PathVariable("viewId") Long viewId,
                                                Principal principal,
                                                @RequestParam(required = false) Long page,
@@ -333,11 +329,11 @@ public class ViewEndpoint {
             throws DatabaseNotFoundException, NotAllowedException, ViewNotFoundException, PaginationException,
             QueryStoreException, DatabaseConnectionException, TableMalformedException, QueryMalformedException,
             ImageNotSupportedException, ColumnParseException, UserNotFoundException, ContainerNotFoundException, ViewMalformedException {
-        log.debug("endpoint find view data, containerId={}, databaseId={}, viewId={}, principal={}, page={}, size={}",
-                containerId, databaseId, viewId, principal, page, size);
+        log.debug("endpoint find view data, databaseId={}, viewId={}, principal={}, page={}, size={}",
+                databaseId, viewId, principal, page, size);
         /* check */
         endpointValidator.validateDataParams(page, size);
-        final Database database = databaseService.find(containerId, databaseId);
+        final Database database = databaseService.find(databaseId);
         if (!database.getIsPublic()) {
             if (principal == null) {
                 log.error("Failed to view data of private view: principal is null");
@@ -351,7 +347,7 @@ public class ViewEndpoint {
         /* find */
         log.trace("find view data for database {}", database);
         final View view = viewService.findById(databaseId, viewId, principal);
-        final QueryResultDto result = queryService.viewFindAll(containerId, databaseId, view, page, size, principal);
+        final QueryResultDto result = queryService.viewFindAll(databaseId, view, page, size, principal);
         log.trace("execute view {}", view);
         log.trace("find view data resulted in result {}", result);
         return ResponseEntity.ok()
@@ -362,20 +358,19 @@ public class ViewEndpoint {
     @Transactional(readOnly = true)
     @Timed(value = "view.data.count", description = "Time needed to retrieve data count from a view")
     @Operation(summary = "Find view data count", security = @SecurityRequirement(name = "bearerAuth"))
-    public ResponseEntity<Long> count(@NotNull @PathVariable("id") Long containerId,
-                                      @NotNull @PathVariable("databaseId") Long databaseId,
+    public ResponseEntity<Long> count(@NotNull @PathVariable("databaseId") Long databaseId,
                                       @NotNull @PathVariable("viewId") Long viewId,
                                       Principal principal)
             throws DatabaseNotFoundException, ViewNotFoundException, QueryStoreException, DatabaseConnectionException,
             TableMalformedException, QueryMalformedException, ImageNotSupportedException, UserNotFoundException,
             ContainerNotFoundException {
-        log.debug("endpoint find view data count, containerId={}, databaseId={}, viewId={}, principal={}",
-                containerId, databaseId, viewId, principal);
+        log.debug("endpoint find view data count, databaseId={}, viewId={}, principal={}",
+                databaseId, viewId, principal);
         /* find */
-        final Database database = databaseService.find(containerId, databaseId);
+        final Database database = databaseService.find(databaseId);
         log.trace("find view data for database {}", database);
         final View view = viewService.findById(databaseId, viewId, principal);
-        final Long result = queryService.viewCount(containerId, databaseId, view, principal);
+        final Long result = queryService.viewCount(databaseId, view, principal);
         log.trace("execute view {}", view);
         log.trace("find view data resulted in result {}", result);
         return ResponseEntity.ok()
diff --git a/dbrepo-query-service/rest-service/src/main/java/at/tuwien/validation/EndpointValidator.java b/dbrepo-query-service/rest-service/src/main/java/at/tuwien/validation/EndpointValidator.java
index 435752f308..a3898b5a4f 100644
--- a/dbrepo-query-service/rest-service/src/main/java/at/tuwien/validation/EndpointValidator.java
+++ b/dbrepo-query-service/rest-service/src/main/java/at/tuwien/validation/EndpointValidator.java
@@ -89,9 +89,9 @@ public class EndpointValidator {
         throw new QueryMalformedException("Query contains forbidden keyword(s): " + Arrays.toString(words.toArray()));
     }
 
-    public void validateOnlyAccessOrPublic(Long containerId, Long databaseId, Principal principal)
+    public void validateOnlyAccessOrPublic(Long databaseId, Principal principal)
             throws DatabaseNotFoundException, NotAllowedException {
-        final Database database = databaseService.find(containerId, databaseId);
+        final Database database = databaseService.find(databaseId);
         if (database.getIsPublic()) {
             log.trace("database with id {} is public: no access needed", databaseId);
             return;
@@ -106,10 +106,10 @@ public class EndpointValidator {
         log.trace("found access {}", access);
     }
 
-    public void validateOnlyWriteOwnOrWriteAllAccess(Long containerId, Long databaseId, Long tableId,
+    public void validateOnlyWriteOwnOrWriteAllAccess(Long databaseId, Long tableId,
                                                      Principal principal)
             throws DatabaseNotFoundException, TableNotFoundException, NotAllowedException {
-        final Table table = tableService.find(containerId, databaseId, tableId);
+        final Table table = tableService.find(databaseId, tableId);
         if (principal == null) {
             log.error("Access not allowed: no authorization provided");
             throw new NotAllowedException("Access not allowed: no authorization provided");
diff --git a/dbrepo-query-service/rest-service/src/test/java/at/tuwien/config/MariaDbContainerConfig.java b/dbrepo-query-service/rest-service/src/test/java/at/tuwien/config/MariaDbContainerConfig.java
new file mode 100644
index 0000000000..42e1d3b2bc
--- /dev/null
+++ b/dbrepo-query-service/rest-service/src/test/java/at/tuwien/config/MariaDbContainerConfig.java
@@ -0,0 +1,70 @@
+package at.tuwien.config;
+
+import at.tuwien.test.BaseTest;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.testcontainers.containers.MariaDBContainer;
+import org.testcontainers.images.PullPolicy;
+
+/**
+ * This class configures the MariaDB container for the integration tests.
+ */
+@Configuration
+public class MariaDbContainerConfig {
+
+    public static CustomMariaDBContainer getContainer() {
+        return CustomMariaDBContainer.getInstance();
+    }
+
+    @Bean
+    public CustomMariaDBContainer mariaDB() {
+        return getContainer();
+    }
+
+    /**
+     * This class represents the customized MariaDB container. It is a singleton to avoid the recreation of containers
+     * which can be very time-consuming.
+     */
+    public static class CustomMariaDBContainer extends MariaDBContainer<CustomMariaDBContainer> {
+
+        private static CustomMariaDBContainer instance;
+
+        private boolean started = false;
+
+        public static synchronized CustomMariaDBContainer getInstance() {
+            if(instance == null) {
+                instance = new CustomMariaDBContainer(BaseTest.IMAGE_1_NAME + ":" + BaseTest.IMAGE_1_VERSION);
+                instance.withImagePullPolicy(PullPolicy.alwaysPull());
+                instance.addFixedExposedPort(BaseTest.CONTAINER_1_PORT, BaseTest.IMAGE_1_PORT);
+                instance.withUsername(BaseTest.CONTAINER_1_PRIVILEGED_USERNAME);
+                instance.withPassword(BaseTest.CONTAINER_1_PRIVILEGED_PASSWORD);
+                instance.withInitScript("init/users.sql");
+                instance.withFileSystemBind("/tmp", "/tmp");
+            }
+            return instance;
+        }
+
+        private CustomMariaDBContainer(String dockerImageName) {
+            super(dockerImageName);
+        }
+
+        @Override
+        protected void configure() {
+            super.configure();
+            this.addEnv("MYSQL_USER", "test"); // MariaDB does not allow this to be root
+        }
+
+        @Override
+        public synchronized void start() {
+            if(!started) {
+                super.start();
+                started = true;
+            }
+        }
+
+        @Override
+        public void stop() {
+            // do nothing, JVM handles shut down
+        }
+    }
+}
diff --git a/dbrepo-query-service/rest-service/src/test/java/at/tuwien/endpoint/ExportEndpointUnitTest.java b/dbrepo-query-service/rest-service/src/test/java/at/tuwien/endpoint/ExportEndpointUnitTest.java
index 2fc48f70c8..f2532f7612 100644
--- a/dbrepo-query-service/rest-service/src/test/java/at/tuwien/endpoint/ExportEndpointUnitTest.java
+++ b/dbrepo-query-service/rest-service/src/test/java/at/tuwien/endpoint/ExportEndpointUnitTest.java
@@ -37,7 +37,7 @@ import java.time.temporal.ChronoUnit;
 import java.util.Optional;
 
 import static org.junit.jupiter.api.Assertions.*;
-import static org.mockito.Mockito.*;
+import static org.mockito.Mockito.when;
 
 @Log4j2
 @SpringBootTest
@@ -83,7 +83,7 @@ public class ExportEndpointUnitTest extends BaseUnitTest {
 
         /* test */
         assertThrows(NotAllowedException.class, () -> {
-            export_generic(CONTAINER_1_ID, DATABASE_1_ID, TABLE_1_ID, DATABASE_1, null, null, null, null);
+            export_generic(DATABASE_1_ID, TABLE_1_ID, DATABASE_1, null, null, null, null);
         });
     }
 
@@ -95,7 +95,7 @@ public class ExportEndpointUnitTest extends BaseUnitTest {
             UserNotFoundException, IOException {
 
         /* test */
-        export_generic(CONTAINER_1_ID, DATABASE_1_ID, TABLE_1_ID, DATABASE_1, null, USER_1_PRINCIPAL, USER_1_USERNAME, null);
+        export_generic(DATABASE_1_ID, TABLE_1_ID, DATABASE_1, null, USER_1_PRINCIPAL, USER_1_USERNAME, null);
     }
 
     @Test
@@ -106,7 +106,7 @@ public class ExportEndpointUnitTest extends BaseUnitTest {
             UserNotFoundException, IOException {
 
         /* test */
-        export_generic(CONTAINER_1_ID, DATABASE_1_ID, TABLE_1_ID, DATABASE_1, null, USER_1_PRINCIPAL, USER_1_USERNAME, DATABASE_1_USER_1_READ_ACCESS);
+        export_generic(DATABASE_1_ID, TABLE_1_ID, DATABASE_1, null, USER_1_PRINCIPAL, USER_1_USERNAME, DATABASE_1_USER_1_READ_ACCESS);
     }
 
     @Test
@@ -116,7 +116,7 @@ public class ExportEndpointUnitTest extends BaseUnitTest {
 
         /* test */
         assertThrows(NotAllowedException.class, () -> {
-            export_generic(CONTAINER_1_ID, DATABASE_1_ID, TABLE_1_ID, DATABASE_1, timestamp, null, null, null);
+            export_generic(DATABASE_1_ID, TABLE_1_ID, DATABASE_1, timestamp, null, null, null);
         });
     }
 
@@ -126,7 +126,7 @@ public class ExportEndpointUnitTest extends BaseUnitTest {
 
         /* test */
         assertThrows(NotAllowedException.class, () -> {
-            export_generic(CONTAINER_1_ID, DATABASE_1_ID, TABLE_1_ID, DATABASE_1, timestamp, null, null, null);
+            export_generic(DATABASE_1_ID, TABLE_1_ID, DATABASE_1, timestamp, null, null, null);
         });
     }
 
@@ -140,7 +140,7 @@ public class ExportEndpointUnitTest extends BaseUnitTest {
 
         /* test */
         assertThrows(NotAllowedException.class, () -> {
-            export_generic(CONTAINER_2_ID, DATABASE_2_ID, TABLE_1_ID, DATABASE_2, null, null, null, null);
+            export_generic(DATABASE_2_ID, TABLE_1_ID, DATABASE_2, null, null, null, null);
         });
     }
 
@@ -152,7 +152,7 @@ public class ExportEndpointUnitTest extends BaseUnitTest {
             UserNotFoundException, IOException {
 
         /* test */
-        export_generic(CONTAINER_2_ID, DATABASE_2_ID, TABLE_1_ID, DATABASE_2, null, USER_2_PRINCIPAL, USER_2_USERNAME, null);
+        export_generic(DATABASE_2_ID, TABLE_1_ID, DATABASE_2, null, USER_2_PRINCIPAL, USER_2_USERNAME, null);
     }
 
     @Test
@@ -163,7 +163,7 @@ public class ExportEndpointUnitTest extends BaseUnitTest {
             UserNotFoundException, IOException {
 
         /* test */
-        export_generic(CONTAINER_2_ID, DATABASE_2_ID, TABLE_1_ID, DATABASE_2, null, USER_2_PRINCIPAL, USER_2_USERNAME, DATABASE_2_USER_1_WRITE_OWN_ACCESS);
+        export_generic(DATABASE_2_ID, TABLE_1_ID, DATABASE_2, null, USER_2_PRINCIPAL, USER_2_USERNAME, DATABASE_2_USER_1_WRITE_OWN_ACCESS);
     }
 
     @Test
@@ -175,7 +175,7 @@ public class ExportEndpointUnitTest extends BaseUnitTest {
         final Instant timestamp = Instant.now();
 
         /* test */
-        export_generic(CONTAINER_2_ID, DATABASE_2_ID, TABLE_1_ID, DATABASE_2, timestamp, USER_2_PRINCIPAL, USER_2_USERNAME, DATABASE_2_USER_1_READ_ACCESS);
+        export_generic(DATABASE_2_ID, TABLE_1_ID, DATABASE_2, timestamp, USER_2_PRINCIPAL, USER_2_USERNAME, DATABASE_2_USER_1_READ_ACCESS);
     }
 
     @Test
@@ -187,14 +187,14 @@ public class ExportEndpointUnitTest extends BaseUnitTest {
         final Instant timestamp = Instant.now().plus(10, ChronoUnit.DAYS);
 
         /* test */
-        export_generic(CONTAINER_2_ID, DATABASE_2_ID, TABLE_1_ID, DATABASE_2, timestamp, USER_2_PRINCIPAL, USER_2_USERNAME, DATABASE_2_USER_1_READ_ACCESS);
+        export_generic(DATABASE_2_ID, TABLE_1_ID, DATABASE_2, timestamp, USER_2_PRINCIPAL, USER_2_USERNAME, DATABASE_2_USER_1_READ_ACCESS);
     }
 
     /* ################################################################################################### */
     /* ## GENERIC TEST CASES                                                                            ## */
     /* ################################################################################################### */
 
-    protected void export_generic(Long containerId, Long databaseId, Long tableId, Database database, Instant timestamp,
+    protected void export_generic(Long databaseId, Long tableId, Database database, Instant timestamp,
                                   Principal principal, String username, DatabaseAccess access) throws IOException,
             DatabaseNotFoundException, UserNotFoundException, TableNotFoundException, DatabaseConnectionException,
             TableMalformedException, QueryMalformedException, ImageNotSupportedException, FileStorageException,
@@ -205,7 +205,7 @@ public class ExportEndpointUnitTest extends BaseUnitTest {
                 .build();
 
         /* mock */
-        when(databaseService.find(containerId, databaseId))
+        when(databaseService.find(databaseId))
                 .thenReturn(database);
         if (access == null) {
             when(databaseAccessRepository.findByDatabaseIdAndUsername(databaseId, username))
@@ -214,13 +214,13 @@ public class ExportEndpointUnitTest extends BaseUnitTest {
             when(databaseAccessRepository.findByDatabaseIdAndUsername(databaseId, username))
                     .thenReturn(Optional.of(access));
         }
-        when(tableRepository.find(containerId, databaseId, tableId))
+        when(tableRepository.find(databaseId, tableId))
                 .thenReturn(Optional.of(TABLE_1));
-        when(queryService.tableFindAll(containerId, databaseId, tableId, timestamp, principal))
+        when(queryService.tableFindAll(databaseId, tableId, timestamp, principal))
                 .thenReturn(resource);
 
         /* test */
-        final ResponseEntity<InputStreamResource> response = exportEndpoint.export(containerId, databaseId, tableId,
+        final ResponseEntity<InputStreamResource> response = exportEndpoint.export(databaseId, tableId,
                 timestamp, principal);
         assertNotNull(response);
         assertEquals(HttpStatus.OK, response.getStatusCode());
diff --git a/dbrepo-query-service/rest-service/src/test/java/at/tuwien/endpoint/QueryEndpointUnitTest.java b/dbrepo-query-service/rest-service/src/test/java/at/tuwien/endpoint/QueryEndpointUnitTest.java
index e9b3371a74..ea03aca6e4 100644
--- a/dbrepo-query-service/rest-service/src/test/java/at/tuwien/endpoint/QueryEndpointUnitTest.java
+++ b/dbrepo-query-service/rest-service/src/test/java/at/tuwien/endpoint/QueryEndpointUnitTest.java
@@ -95,7 +95,7 @@ public class QueryEndpointUnitTest extends BaseUnitTest {
 
         /* test */
         assertThrows(QueryMalformedException.class, () -> {
-            generic_execute(CONTAINER_3_ID, DATABASE_3_ID, statement, null, USER_2_PRINCIPAL, DATABASE_3, null);
+            generic_execute(DATABASE_3_ID, statement, null, USER_2_PRINCIPAL, DATABASE_3, null);
         });
     }
 
@@ -106,7 +106,7 @@ public class QueryEndpointUnitTest extends BaseUnitTest {
 
         /* test */
         assertThrows(QueryMalformedException.class, () -> {
-            generic_execute(CONTAINER_3_ID, DATABASE_3_ID, statement, USER_2_USERNAME, USER_2_PRINCIPAL, DATABASE_3, DATABASE_3_USER_2_READ_ACCESS);
+            generic_execute(DATABASE_3_ID, statement, USER_2_USERNAME, USER_2_PRINCIPAL, DATABASE_3, DATABASE_3_USER_2_READ_ACCESS);
         });
     }
 
@@ -117,7 +117,7 @@ public class QueryEndpointUnitTest extends BaseUnitTest {
 
         /* test */
         assertThrows(QueryMalformedException.class, () -> {
-            generic_execute(CONTAINER_3_ID, DATABASE_3_ID, statement, USER_2_USERNAME, USER_2_PRINCIPAL, DATABASE_3, DATABASE_3_USER_2_READ_ACCESS);
+            generic_execute(DATABASE_3_ID, statement, USER_2_USERNAME, USER_2_PRINCIPAL, DATABASE_3, DATABASE_3_USER_2_READ_ACCESS);
         });
     }
 
@@ -128,7 +128,7 @@ public class QueryEndpointUnitTest extends BaseUnitTest {
 
         /* test */
         assertThrows(QueryMalformedException.class, () -> {
-            generic_execute(CONTAINER_3_ID, DATABASE_3_ID, statement, null, USER_2_PRINCIPAL, DATABASE_3, null);
+            generic_execute(DATABASE_3_ID, statement, null, USER_2_PRINCIPAL, DATABASE_3, null);
         });
     }
 
@@ -138,7 +138,7 @@ public class QueryEndpointUnitTest extends BaseUnitTest {
 
         /* test */
         assertThrows(AccessDeniedException.class, () -> {
-            generic_execute(CONTAINER_3_ID, DATABASE_3_ID, QUERY_4_STATEMENT, null, null, DATABASE_3, null);
+            generic_execute(DATABASE_3_ID, QUERY_4_STATEMENT, null, null, DATABASE_3, null);
         });
     }
 
@@ -150,7 +150,7 @@ public class QueryEndpointUnitTest extends BaseUnitTest {
             PaginationException {
 
         /* test */
-        generic_execute(CONTAINER_3_ID, DATABASE_3_ID, QUERY_4_STATEMENT, USER_2_USERNAME, USER_2_PRINCIPAL, DATABASE_3, DATABASE_3_USER_2_WRITE_ALL_ACCESS);
+        generic_execute(DATABASE_3_ID, QUERY_4_STATEMENT, USER_2_USERNAME, USER_2_PRINCIPAL, DATABASE_3, DATABASE_3_USER_2_WRITE_ALL_ACCESS);
     }
 
     @Test
@@ -161,7 +161,7 @@ public class QueryEndpointUnitTest extends BaseUnitTest {
             PaginationException {
 
         /* test */
-        generic_execute(CONTAINER_3_ID, DATABASE_3_ID, QUERY_4_STATEMENT, USER_2_USERNAME, USER_2_PRINCIPAL, DATABASE_3, DATABASE_3_USER_2_WRITE_ALL_ACCESS);
+        generic_execute(DATABASE_3_ID, QUERY_4_STATEMENT, USER_2_USERNAME, USER_2_PRINCIPAL, DATABASE_3, DATABASE_3_USER_2_WRITE_ALL_ACCESS);
     }
 
     @Test
@@ -172,7 +172,7 @@ public class QueryEndpointUnitTest extends BaseUnitTest {
             PaginationException {
 
         /* test */
-        generic_execute(CONTAINER_3_ID, DATABASE_3_ID, QUERY_4_STATEMENT, USER_2_USERNAME, USER_2_PRINCIPAL, DATABASE_3, DATABASE_3_USER_2_WRITE_ALL_ACCESS);
+        generic_execute(DATABASE_3_ID, QUERY_4_STATEMENT, USER_2_USERNAME, USER_2_PRINCIPAL, DATABASE_3, DATABASE_3_USER_2_WRITE_ALL_ACCESS);
     }
 
     @Test
@@ -183,7 +183,7 @@ public class QueryEndpointUnitTest extends BaseUnitTest {
             PaginationException {
 
         /* test */
-        generic_execute(CONTAINER_3_ID, DATABASE_3_ID, QUERY_4_STATEMENT, USER_2_USERNAME, USER_2_PRINCIPAL, DATABASE_3, DATABASE_3_USER_2_WRITE_ALL_ACCESS);
+        generic_execute(DATABASE_3_ID, QUERY_4_STATEMENT, USER_2_USERNAME, USER_2_PRINCIPAL, DATABASE_3, DATABASE_3_USER_2_WRITE_ALL_ACCESS);
     }
 
     @Test
@@ -194,7 +194,7 @@ public class QueryEndpointUnitTest extends BaseUnitTest {
             PaginationException {
 
         /* test */
-        generic_reExecute(CONTAINER_3_ID, DATABASE_3_ID, QUERY_4_ID, QUERY_4, QUERY_4_RESULT_ID, QUERY_4_RESULT_DTO,
+        generic_reExecute(DATABASE_3_ID, QUERY_4_ID, QUERY_4, QUERY_4_RESULT_ID, QUERY_4_RESULT_DTO,
                 null, null, DATABASE_3, null);
     }
 
@@ -206,7 +206,7 @@ public class QueryEndpointUnitTest extends BaseUnitTest {
             PaginationException, QueryNotFoundException {
 
         /* test */
-        generic_reExecute(CONTAINER_3_ID, DATABASE_3_ID, QUERY_4_ID, QUERY_4, QUERY_4_RESULT_ID, QUERY_4_RESULT_DTO,
+        generic_reExecute(DATABASE_3_ID, QUERY_4_ID, QUERY_4, QUERY_4_RESULT_ID, QUERY_4_RESULT_DTO,
                 USER_2_USERNAME, USER_2_PRINCIPAL, DATABASE_3, DATABASE_3_USER_1_READ_ACCESS);
     }
 
@@ -218,7 +218,7 @@ public class QueryEndpointUnitTest extends BaseUnitTest {
             PaginationException, QueryNotFoundException {
 
         /* test */
-        generic_reExecute(CONTAINER_3_ID, DATABASE_3_ID, QUERY_4_ID, QUERY_4, QUERY_4_RESULT_ID, QUERY_4_RESULT_DTO,
+        generic_reExecute(DATABASE_3_ID, QUERY_4_ID, QUERY_4, QUERY_4_RESULT_ID, QUERY_4_RESULT_DTO,
                 USER_2_USERNAME, USER_2_PRINCIPAL, DATABASE_3, DATABASE_3_USER_1_WRITE_OWN_ACCESS);
     }
 
@@ -230,7 +230,7 @@ public class QueryEndpointUnitTest extends BaseUnitTest {
             ContainerNotFoundException, IOException, NotAllowedException {
 
         /* test */
-        export_generic(CONTAINER_3_ID, DATABASE_3_ID, QUERY_3_ID, null, null, DATABASE_3, null, null, HttpStatus.OK);
+        export_generic(DATABASE_3_ID, QUERY_3_ID, null, null, DATABASE_3, null, null, HttpStatus.OK);
     }
 
     @Test
@@ -238,7 +238,7 @@ public class QueryEndpointUnitTest extends BaseUnitTest {
     public void export_publicAnonymizedInvalidFormat_fails() throws UserNotFoundException, QueryStoreException, DatabaseConnectionException, TableMalformedException, NotAllowedException, QueryMalformedException, QueryNotFoundException, DatabaseNotFoundException, ImageNotSupportedException, IOException, FileStorageException, ContainerNotFoundException {
 
         /* test */
-        export_generic(CONTAINER_3_ID, DATABASE_3_ID, QUERY_3_ID, null, null, DATABASE_3, null, "application/json", HttpStatus.NOT_IMPLEMENTED);
+        export_generic(DATABASE_3_ID, QUERY_3_ID, null, null, DATABASE_3, null, "application/json", HttpStatus.NOT_IMPLEMENTED);
     }
 
     @Test
@@ -249,7 +249,7 @@ public class QueryEndpointUnitTest extends BaseUnitTest {
             ContainerNotFoundException, IOException, NotAllowedException {
 
         /* test */
-        export_generic(CONTAINER_3_ID, DATABASE_3_ID, QUERY_3_ID, USER_2_USERNAME, USER_2_PRINCIPAL, DATABASE_3, DATABASE_3_USER_1_READ_ACCESS, null, HttpStatus.OK);
+        export_generic(DATABASE_3_ID, QUERY_3_ID, USER_2_USERNAME, USER_2_PRINCIPAL, DATABASE_3, DATABASE_3_USER_1_READ_ACCESS, null, HttpStatus.OK);
     }
 
     @Test
@@ -260,7 +260,7 @@ public class QueryEndpointUnitTest extends BaseUnitTest {
             ContainerNotFoundException, IOException, NotAllowedException {
 
         /* test */
-        export_generic(CONTAINER_3_ID, DATABASE_3_ID, QUERY_4_ID, USER_2_USERNAME, USER_2_PRINCIPAL, DATABASE_3, DATABASE_3_USER_1_WRITE_OWN_ACCESS, null, HttpStatus.OK);
+        export_generic(DATABASE_3_ID, QUERY_4_ID, USER_2_USERNAME, USER_2_PRINCIPAL, DATABASE_3, DATABASE_3_USER_1_WRITE_OWN_ACCESS, null, HttpStatus.OK);
     }
 
     @Test
@@ -271,7 +271,7 @@ public class QueryEndpointUnitTest extends BaseUnitTest {
             ContainerNotFoundException, IOException, NotAllowedException {
 
         /* test */
-        export_generic(CONTAINER_3_ID, DATABASE_3_ID, QUERY_4_ID, USER_2_USERNAME, USER_2_PRINCIPAL, DATABASE_3, DATABASE_3_USER_1_WRITE_ALL_ACCESS, null, HttpStatus.OK);
+        export_generic(DATABASE_3_ID, QUERY_4_ID, USER_2_USERNAME, USER_2_PRINCIPAL, DATABASE_3, DATABASE_3_USER_1_WRITE_ALL_ACCESS, null, HttpStatus.OK);
     }
 
     /* ################################################################################################### */
@@ -285,7 +285,7 @@ public class QueryEndpointUnitTest extends BaseUnitTest {
 
         /* test */
         assertThrows(AccessDeniedException.class, () -> {
-            generic_execute(CONTAINER_2_ID, DATABASE_2_ID, QUERY_1_STATEMENT, null, principal, DATABASE_2, null);
+            generic_execute(DATABASE_2_ID, QUERY_1_STATEMENT, null, principal, DATABASE_2, null);
         });
     }
 
@@ -297,7 +297,7 @@ public class QueryEndpointUnitTest extends BaseUnitTest {
             PaginationException {
 
         /* test */
-        generic_execute(CONTAINER_2_ID, DATABASE_2_ID, QUERY_1_STATEMENT, USER_2_USERNAME, USER_2_PRINCIPAL, DATABASE_2, DATABASE_2_USER_1_READ_ACCESS);
+        generic_execute(DATABASE_2_ID, QUERY_1_STATEMENT, USER_2_USERNAME, USER_2_PRINCIPAL, DATABASE_2, DATABASE_2_USER_1_READ_ACCESS);
     }
 
     @Test
@@ -308,7 +308,7 @@ public class QueryEndpointUnitTest extends BaseUnitTest {
             PaginationException {
 
         /* test */
-        generic_execute(CONTAINER_2_ID, DATABASE_2_ID, QUERY_1_STATEMENT, USER_2_USERNAME, USER_2_PRINCIPAL, DATABASE_2, DATABASE_2_USER_1_WRITE_OWN_ACCESS);
+        generic_execute(DATABASE_2_ID, QUERY_1_STATEMENT, USER_2_USERNAME, USER_2_PRINCIPAL, DATABASE_2, DATABASE_2_USER_1_WRITE_OWN_ACCESS);
     }
 
     @Test
@@ -319,7 +319,7 @@ public class QueryEndpointUnitTest extends BaseUnitTest {
             PaginationException {
 
         /* test */
-        generic_execute(CONTAINER_2_ID, DATABASE_2_ID, QUERY_1_STATEMENT, USER_2_USERNAME, USER_2_PRINCIPAL, DATABASE_2, DATABASE_2_USER_1_WRITE_ALL_ACCESS);
+        generic_execute(DATABASE_2_ID, QUERY_1_STATEMENT, USER_2_USERNAME, USER_2_PRINCIPAL, DATABASE_2, DATABASE_2_USER_1_WRITE_ALL_ACCESS);
     }
 
     @Test
@@ -330,7 +330,7 @@ public class QueryEndpointUnitTest extends BaseUnitTest {
             PaginationException {
 
         /* test */
-        generic_execute(CONTAINER_2_ID, DATABASE_2_ID, QUERY_1_STATEMENT, USER_1_USERNAME, USER_1_PRINCIPAL, DATABASE_2, DATABASE_2_USER_1_WRITE_ALL_ACCESS);
+        generic_execute(DATABASE_2_ID, QUERY_1_STATEMENT, USER_1_USERNAME, USER_1_PRINCIPAL, DATABASE_2, DATABASE_2_USER_1_WRITE_ALL_ACCESS);
     }
 
     @Test
@@ -339,7 +339,7 @@ public class QueryEndpointUnitTest extends BaseUnitTest {
 
         /* test */
         assertThrows(NotAllowedException.class, () -> {
-            generic_reExecute(CONTAINER_2_ID, DATABASE_2_ID, QUERY_1_ID, QUERY_1, QUERY_1_RESULT_ID, QUERY_1_RESULT_DTO,
+            generic_reExecute(DATABASE_2_ID, QUERY_1_ID, QUERY_1, QUERY_1_RESULT_ID, QUERY_1_RESULT_DTO,
                     null, null, DATABASE_2, null);
         });
     }
@@ -352,7 +352,7 @@ public class QueryEndpointUnitTest extends BaseUnitTest {
             PaginationException, QueryNotFoundException {
 
         /* test */
-        generic_reExecute(CONTAINER_2_ID, DATABASE_2_ID, QUERY_1_ID, QUERY_1, QUERY_1_RESULT_ID, QUERY_1_RESULT_DTO,
+        generic_reExecute(DATABASE_2_ID, QUERY_1_ID, QUERY_1, QUERY_1_RESULT_ID, QUERY_1_RESULT_DTO,
                 USER_2_USERNAME, USER_2_PRINCIPAL, DATABASE_2, DATABASE_2_USER_1_READ_ACCESS);
     }
 
@@ -364,7 +364,7 @@ public class QueryEndpointUnitTest extends BaseUnitTest {
             PaginationException, QueryNotFoundException {
 
         /* test */
-        generic_reExecute(CONTAINER_2_ID, DATABASE_2_ID, QUERY_1_ID, QUERY_1, QUERY_1_RESULT_ID, QUERY_1_RESULT_DTO,
+        generic_reExecute(DATABASE_2_ID, QUERY_1_ID, QUERY_1, QUERY_1_RESULT_ID, QUERY_1_RESULT_DTO,
                 USER_2_USERNAME, USER_2_PRINCIPAL, DATABASE_2, DATABASE_2_USER_1_WRITE_OWN_ACCESS);
     }
 
@@ -376,7 +376,7 @@ public class QueryEndpointUnitTest extends BaseUnitTest {
             PaginationException, QueryNotFoundException {
 
         /* test */
-        generic_reExecute(CONTAINER_2_ID, DATABASE_2_ID, QUERY_1_ID, QUERY_1, QUERY_1_RESULT_ID, QUERY_1_RESULT_DTO,
+        generic_reExecute(DATABASE_2_ID, QUERY_1_ID, QUERY_1, QUERY_1_RESULT_ID, QUERY_1_RESULT_DTO,
                 USER_2_USERNAME, USER_2_PRINCIPAL, DATABASE_2, DATABASE_2_USER_1_WRITE_ALL_ACCESS);
     }
 
@@ -386,7 +386,7 @@ public class QueryEndpointUnitTest extends BaseUnitTest {
 
         /* test */
         assertThrows(NotAllowedException.class, () -> {
-            export_generic(CONTAINER_2_ID, DATABASE_2_ID, QUERY_1_ID, null, null, DATABASE_2, null, null, HttpStatus.OK);
+            export_generic(DATABASE_2_ID, QUERY_1_ID, null, null, DATABASE_2, null, null, HttpStatus.OK);
         });
     }
 
@@ -395,7 +395,7 @@ public class QueryEndpointUnitTest extends BaseUnitTest {
     public void export_privateInvalidFormat_fails() throws UserNotFoundException, QueryStoreException, DatabaseConnectionException, TableMalformedException, NotAllowedException, QueryMalformedException, QueryNotFoundException, DatabaseNotFoundException, ImageNotSupportedException, IOException, FileStorageException, ContainerNotFoundException {
 
         /* test */
-        export_generic(CONTAINER_2_ID, DATABASE_2_ID, QUERY_1_ID, USER_2_USERNAME, USER_2_PRINCIPAL, DATABASE_2, DATABASE_2_USER_2_READ_ACCESS, "application/json", HttpStatus.NOT_IMPLEMENTED);
+        export_generic(DATABASE_2_ID, QUERY_1_ID, USER_2_USERNAME, USER_2_PRINCIPAL, DATABASE_2, DATABASE_2_USER_2_READ_ACCESS, "application/json", HttpStatus.NOT_IMPLEMENTED);
     }
 
     @Test
@@ -406,7 +406,7 @@ public class QueryEndpointUnitTest extends BaseUnitTest {
             ContainerNotFoundException, IOException {
 
         /* test */
-        export_generic(CONTAINER_2_ID, DATABASE_2_ID, QUERY_1_ID, USER_2_USERNAME, USER_2_PRINCIPAL, DATABASE_2, DATABASE_2_USER_1_READ_ACCESS, null, HttpStatus.OK);
+        export_generic(DATABASE_2_ID, QUERY_1_ID, USER_2_USERNAME, USER_2_PRINCIPAL, DATABASE_2, DATABASE_2_USER_1_READ_ACCESS, null, HttpStatus.OK);
     }
 
     @Test
@@ -417,7 +417,7 @@ public class QueryEndpointUnitTest extends BaseUnitTest {
             ContainerNotFoundException, IOException {
 
         /* test */
-        export_generic(CONTAINER_2_ID, DATABASE_2_ID, QUERY_1_ID, USER_2_USERNAME, USER_2_PRINCIPAL, DATABASE_2, DATABASE_2_USER_1_WRITE_OWN_ACCESS, null, HttpStatus.OK);
+        export_generic(DATABASE_2_ID, QUERY_1_ID, USER_2_USERNAME, USER_2_PRINCIPAL, DATABASE_2, DATABASE_2_USER_1_WRITE_OWN_ACCESS, null, HttpStatus.OK);
     }
 
     @Test
@@ -428,14 +428,14 @@ public class QueryEndpointUnitTest extends BaseUnitTest {
             ContainerNotFoundException, IOException {
 
         /* test */
-        export_generic(CONTAINER_2_ID, DATABASE_2_ID, QUERY_1_ID, USER_2_USERNAME, USER_2_PRINCIPAL, DATABASE_2, DATABASE_2_USER_1_WRITE_ALL_ACCESS, null, HttpStatus.OK);
+        export_generic(DATABASE_2_ID, QUERY_1_ID, USER_2_USERNAME, USER_2_PRINCIPAL, DATABASE_2, DATABASE_2_USER_1_WRITE_ALL_ACCESS, null, HttpStatus.OK);
     }
 
     /* ################################################################################################### */
     /* ## GENERIC TEST CASES                                                                            ## */
     /* ################################################################################################### */
 
-    protected void generic_execute(Long containerId, Long databaseId, String statement, String username,
+    protected void generic_execute(Long databaseId, String statement, String username,
                                    Principal principal, Database database, DatabaseAccess access)
             throws UserNotFoundException, QueryStoreException, TableMalformedException, DatabaseConnectionException,
             QueryMalformedException, ColumnParseException, DatabaseNotFoundException, ImageNotSupportedException,
@@ -449,9 +449,9 @@ public class QueryEndpointUnitTest extends BaseUnitTest {
         final String sortColumn = "location";
 
         /* mock */
-        when(databaseRepository.findByContainerIdAndDatabaseId(containerId, databaseId))
+        when(databaseRepository.findByDatabaseId(databaseId))
                 .thenReturn(Optional.of(database));
-        log.trace("mock database for container with id {} and database id {}", containerId, databaseId);
+        log.trace("mock database for container database id {}", databaseId);
         if (access == null) {
             when(databaseAccessRepository.findByDatabaseIdAndUsername(databaseId, username))
                     .thenReturn(Optional.empty());
@@ -461,12 +461,12 @@ public class QueryEndpointUnitTest extends BaseUnitTest {
                     .thenReturn(Optional.of(access));
             log.trace("mock access {} for database with id {} and username {}", access.getType(), databaseId, username);
         }
-        when(queryService.execute(containerId, databaseId, request, principal, page, size, sortDirection, sortColumn))
+        when(queryService.execute(databaseId, request, principal, page, size, sortDirection, sortColumn))
                 .thenReturn(QUERY_1_RESULT_DTO);
-        log.trace("mock query service for container with id {} and database with id {}", containerId, databaseId);
+        log.trace("mock query service for container database with id {}", databaseId);
 
         /* test */
-        final ResponseEntity<QueryResultDto> response = queryEndpoint.execute(containerId, databaseId, request,
+        final ResponseEntity<QueryResultDto> response = queryEndpoint.execute(databaseId, request,
                 page, size, principal, sortDirection, sortColumn);
         assertEquals(HttpStatus.ACCEPTED, response.getStatusCode());
         assertNotNull(response.getBody());
@@ -476,7 +476,7 @@ public class QueryEndpointUnitTest extends BaseUnitTest {
         assertEquals(QUERY_1_RESULT_RESULT, response.getBody().getResult());
     }
 
-    protected void generic_reExecute(Long containerId, Long databaseId, Long queryId, Query query, Long resultId,
+    protected void generic_reExecute(Long databaseId, Long queryId, Query query, Long resultId,
                                      QueryResultDto result, String username, Principal principal, Database database,
                                      DatabaseAccess access)
             throws UserNotFoundException, QueryStoreException, DatabaseConnectionException, QueryNotFoundException,
@@ -488,9 +488,9 @@ public class QueryEndpointUnitTest extends BaseUnitTest {
         final String sortColumn = "location";
 
         /* mock */
-        when(databaseRepository.findByContainerIdAndDatabaseId(containerId, databaseId))
+        when(databaseRepository.findByDatabaseId(databaseId))
                 .thenReturn(Optional.of(database));
-        when(storeService.findOne(containerId, databaseId, queryId, principal))
+        when(storeService.findOne(databaseId, queryId, principal))
                 .thenReturn(query);
         if (access == null) {
             when(databaseAccessRepository.findByDatabaseIdAndUsername(databaseId, username))
@@ -499,18 +499,18 @@ public class QueryEndpointUnitTest extends BaseUnitTest {
             when(databaseAccessRepository.findByDatabaseIdAndUsername(databaseId, username))
                     .thenReturn(Optional.of(access));
         }
-        when(queryService.reExecute(containerId, databaseId, query, page, size, sortDirection, sortColumn, principal))
+        when(queryService.reExecute(databaseId, query, page, size, sortDirection, sortColumn, principal))
                 .thenReturn(result);
 
         /* test */
-        final ResponseEntity<QueryResultDto> response = queryEndpoint.reExecute(containerId, databaseId, queryId,
+        final ResponseEntity<QueryResultDto> response = queryEndpoint.reExecute(databaseId, queryId,
                 principal, page, size, sortDirection, sortColumn);
         assertEquals(HttpStatus.ACCEPTED, response.getStatusCode());
         assertNotNull(response.getBody());
         assertEquals(resultId, response.getBody().getId());
     }
 
-    protected void export_generic(Long containerId, Long databaseId, Long queryId, String username, Principal principal,
+    protected void export_generic(Long databaseId, Long queryId, String username, Principal principal,
                                   Database database, DatabaseAccess access, String accept, HttpStatus status) throws IOException,
             UserNotFoundException, QueryStoreException, DatabaseConnectionException, QueryNotFoundException,
             DatabaseNotFoundException, ImageNotSupportedException, TableMalformedException, QueryMalformedException,
@@ -521,7 +521,7 @@ public class QueryEndpointUnitTest extends BaseUnitTest {
                 .build();
 
         /* mock */
-        when(databaseRepository.findByContainerIdAndDatabaseId(containerId, databaseId))
+        when(databaseRepository.findByDatabaseId(databaseId))
                 .thenReturn(Optional.of(database));
         if (access == null) {
             when(databaseAccessRepository.findByDatabaseIdAndUsername(databaseId, username))
@@ -530,13 +530,13 @@ public class QueryEndpointUnitTest extends BaseUnitTest {
             when(databaseAccessRepository.findByDatabaseIdAndUsername(databaseId, username))
                     .thenReturn(Optional.of(access));
         }
-        when(storeService.findOne(containerId, databaseId, queryId, principal))
+        when(storeService.findOne(databaseId, queryId, principal))
                 .thenReturn(QUERY_1);
-        when(queryService.findOne(containerId, databaseId, queryId, principal))
+        when(queryService.findOne(databaseId, queryId, principal))
                 .thenReturn(resource);
 
         /* test */
-        final ResponseEntity<?> response = queryEndpoint.export(containerId, databaseId, queryId, accept, principal);
+        final ResponseEntity<?> response = queryEndpoint.export(databaseId, queryId, accept, principal);
         assertEquals(status, response.getStatusCode());
         if (status.equals(HttpStatus.OK)) {
             assertNotNull(response.getBody());
diff --git a/dbrepo-query-service/rest-service/src/test/java/at/tuwien/endpoint/StoreEndpointUnitTest.java b/dbrepo-query-service/rest-service/src/test/java/at/tuwien/endpoint/StoreEndpointUnitTest.java
index e4d98d8044..72967d0e44 100644
--- a/dbrepo-query-service/rest-service/src/test/java/at/tuwien/endpoint/StoreEndpointUnitTest.java
+++ b/dbrepo-query-service/rest-service/src/test/java/at/tuwien/endpoint/StoreEndpointUnitTest.java
@@ -81,7 +81,7 @@ public class StoreEndpointUnitTest extends BaseUnitTest {
 
         /* test */
         assertThrows(NotAllowedException.class, () -> {
-            findAll_generic(CONTAINER_1_ID, DATABASE_1_ID, DATABASE_1, null);
+            findAll_generic(DATABASE_1_ID, DATABASE_1, null);
         });
     }
 
@@ -91,7 +91,7 @@ public class StoreEndpointUnitTest extends BaseUnitTest {
             ContainerNotFoundException, DatabaseConnectionException, TableMalformedException, UserNotFoundException, NotAllowedException {
 
         /* test */
-        findAll_generic(CONTAINER_3_ID, DATABASE_3_ID, DATABASE_3, null);
+        findAll_generic(DATABASE_3_ID, DATABASE_3, null);
     }
 
     @Test
@@ -100,7 +100,7 @@ public class StoreEndpointUnitTest extends BaseUnitTest {
             ContainerNotFoundException, DatabaseConnectionException, TableMalformedException, UserNotFoundException, NotAllowedException {
 
         /* test */
-        findAll_generic(CONTAINER_1_ID, DATABASE_1_ID, DATABASE_1, USER_1_PRINCIPAL);
+        findAll_generic(DATABASE_1_ID, DATABASE_1, USER_1_PRINCIPAL);
     }
 
     @Test
@@ -109,7 +109,7 @@ public class StoreEndpointUnitTest extends BaseUnitTest {
             ContainerNotFoundException, DatabaseConnectionException, TableMalformedException, UserNotFoundException, NotAllowedException {
 
         /* test */
-        findAll_generic(CONTAINER_1_ID, DATABASE_1_ID, DATABASE_1, USER_1_PRINCIPAL);
+        findAll_generic(DATABASE_1_ID, DATABASE_1, USER_1_PRINCIPAL);
     }
 
     @Test
@@ -123,7 +123,7 @@ public class StoreEndpointUnitTest extends BaseUnitTest {
 
         /* test */
         assertThrows(NotAllowedException.class, () -> {
-            findAll_generic(CONTAINER_1_ID, DATABASE_1_ID, DATABASE_1, USER_2_PRINCIPAL);
+            findAll_generic(DATABASE_1_ID, DATABASE_1, USER_2_PRINCIPAL);
         });
     }
 
@@ -139,7 +139,7 @@ public class StoreEndpointUnitTest extends BaseUnitTest {
                 .find(DATABASE_3_ID, USER_2_USERNAME);
 
         /* test */
-        findAll_generic(CONTAINER_3_ID, DATABASE_3_ID, DATABASE_3, USER_2_PRINCIPAL);
+        findAll_generic(DATABASE_3_ID, DATABASE_3, USER_2_PRINCIPAL);
     }
 
     @Test
@@ -153,7 +153,7 @@ public class StoreEndpointUnitTest extends BaseUnitTest {
                 .thenReturn(DATABASE_1_USER_1_READ_ACCESS);
 
         /* test */
-        findAll_generic(CONTAINER_2_ID, DATABASE_2_ID, DATABASE_2, USER_1_PRINCIPAL);
+        findAll_generic(DATABASE_2_ID, DATABASE_2, USER_1_PRINCIPAL);
     }
 
     @Test
@@ -166,7 +166,7 @@ public class StoreEndpointUnitTest extends BaseUnitTest {
                 .thenReturn(Optional.of(USER_1));
 
         /* test */
-        final QueryDto response = find_generic(CONTAINER_3_ID, DATABASE_3_ID, DATABASE_3, QUERY_4_ID, QUERY_4, null, null, null);
+        final QueryDto response = find_generic(DATABASE_3_ID, DATABASE_3, QUERY_4_ID, QUERY_4, null, null, null);
         assertEquals(QUERY_4_ID, response.getId());
         assertEquals(QUERY_4_STATEMENT, response.getQuery());
     }
@@ -181,7 +181,7 @@ public class StoreEndpointUnitTest extends BaseUnitTest {
 
         /* test */
         assertThrows(NotAllowedException.class, () -> {
-            find_generic(CONTAINER_1_ID, DATABASE_1_ID, DATABASE_1, QUERY_1_ID, QUERY_1, null, null, null);
+            find_generic(DATABASE_1_ID, DATABASE_1, QUERY_1_ID, QUERY_1, null, null, null);
         });
     }
 
@@ -191,7 +191,7 @@ public class StoreEndpointUnitTest extends BaseUnitTest {
             ImageNotSupportedException, UserNotFoundException, NotAllowedException, DatabaseConnectionException {
 
         /* test */
-        final QueryDto response = find_generic(CONTAINER_1_ID, DATABASE_1_ID, DATABASE_1, QUERY_1_ID, QUERY_1, USER_1_USERNAME, USER_1, USER_1_PRINCIPAL);
+        final QueryDto response = find_generic(DATABASE_1_ID, DATABASE_1, QUERY_1_ID, QUERY_1, USER_1_USERNAME, USER_1, USER_1_PRINCIPAL);
         assertEquals(QUERY_1_ID, response.getId());
         assertEquals(QUERY_1_STATEMENT, response.getQuery());
     }
@@ -202,7 +202,7 @@ public class StoreEndpointUnitTest extends BaseUnitTest {
             ImageNotSupportedException, UserNotFoundException, NotAllowedException, DatabaseConnectionException {
 
         /* test */
-        final QueryDto response = find_generic(CONTAINER_1_ID, DATABASE_1_ID, DATABASE_1, QUERY_1_ID, QUERY_1, USER_1_USERNAME, USER_1, USER_1_PRINCIPAL);
+        final QueryDto response = find_generic(DATABASE_1_ID, DATABASE_1, QUERY_1_ID, QUERY_1, USER_1_USERNAME, USER_1, USER_1_PRINCIPAL);
         assertEquals(QUERY_1_ID, response.getId());
         assertEquals(QUERY_1_STATEMENT, response.getQuery());
     }
@@ -213,7 +213,7 @@ public class StoreEndpointUnitTest extends BaseUnitTest {
 
         /* test */
         assertThrows(QueryNotFoundException.class, () -> {
-            find_generic(CONTAINER_1_ID, DATABASE_1_ID, DATABASE_1, QUERY_1_ID, null, USER_1_USERNAME, USER_1, USER_1_PRINCIPAL);
+            find_generic(DATABASE_1_ID, DATABASE_1, QUERY_1_ID, null, USER_1_USERNAME, USER_1, USER_1_PRINCIPAL);
         });
     }
 
@@ -223,7 +223,7 @@ public class StoreEndpointUnitTest extends BaseUnitTest {
 
         /* test */
         assertThrows(DatabaseNotFoundException.class, () -> {
-            find_generic(CONTAINER_1_ID, DATABASE_1_ID, null, QUERY_1_ID, QUERY_1, USER_1_USERNAME, USER_1, USER_1_PRINCIPAL);
+            find_generic(DATABASE_1_ID, null, QUERY_1_ID, QUERY_1, USER_1_USERNAME, USER_1, USER_1_PRINCIPAL);
         });
     }
 
@@ -234,7 +234,7 @@ public class StoreEndpointUnitTest extends BaseUnitTest {
             DatabaseNotFoundException, ImageNotSupportedException {
 
         /* test */
-        final QueryDto response = persist_generic(CONTAINER_1_ID, DATABASE_1_ID, DATABASE_1, QUERY_1_ID, QUERY_1, USER_1_USERNAME, USER_1, USER_1_PRINCIPAL, DATABASE_1_USER_1_READ_ACCESS);
+        final QueryDto response = persist_generic(DATABASE_1_ID, DATABASE_1, QUERY_1_ID, QUERY_1, USER_1_USERNAME, USER_1, USER_1_PRINCIPAL, DATABASE_1_USER_1_READ_ACCESS);
         assertEquals(QUERY_1_ID, response.getId());
         assertEquals(QUERY_1_STATEMENT, response.getQuery());
     }
@@ -246,7 +246,7 @@ public class StoreEndpointUnitTest extends BaseUnitTest {
             DatabaseNotFoundException, ImageNotSupportedException {
 
         /* test */
-        final QueryDto response = persist_generic(CONTAINER_1_ID, DATABASE_1_ID, DATABASE_1, QUERY_1_ID, QUERY_1, USER_1_USERNAME, USER_1, USER_1_PRINCIPAL, DATABASE_1_USER_1_WRITE_OWN_ACCESS);
+        final QueryDto response = persist_generic(DATABASE_1_ID, DATABASE_1, QUERY_1_ID, QUERY_1, USER_1_USERNAME, USER_1, USER_1_PRINCIPAL, DATABASE_1_USER_1_WRITE_OWN_ACCESS);
         assertEquals(QUERY_1_ID, response.getId());
         assertEquals(QUERY_1_STATEMENT, response.getQuery());
     }
@@ -258,7 +258,7 @@ public class StoreEndpointUnitTest extends BaseUnitTest {
             DatabaseNotFoundException, ImageNotSupportedException {
 
         /* test */
-        final QueryDto response = persist_generic(CONTAINER_1_ID, DATABASE_1_ID, DATABASE_1, QUERY_1_ID, QUERY_1, USER_1_USERNAME, USER_1, USER_1_PRINCIPAL, DATABASE_1_USER_1_WRITE_ALL_ACCESS);
+        final QueryDto response = persist_generic(DATABASE_1_ID, DATABASE_1, QUERY_1_ID, QUERY_1, USER_1_USERNAME, USER_1, USER_1_PRINCIPAL, DATABASE_1_USER_1_WRITE_ALL_ACCESS);
         assertEquals(QUERY_1_ID, response.getId());
         assertEquals(QUERY_1_STATEMENT, response.getQuery());
     }
@@ -273,7 +273,7 @@ public class StoreEndpointUnitTest extends BaseUnitTest {
 
         /* test */
         assertThrows(NotAllowedException.class, () -> {
-            persist_generic(CONTAINER_1_ID, DATABASE_1_ID, DATABASE_1, QUERY_1_ID, QUERY_1, USER_2_USERNAME, USER_2, USER_2_PRINCIPAL, DATABASE_1_USER_2_WRITE_ALL_ACCESS);
+            persist_generic(DATABASE_1_ID, DATABASE_1, QUERY_1_ID, QUERY_1, USER_2_USERNAME, USER_2, USER_2_PRINCIPAL, DATABASE_1_USER_2_WRITE_ALL_ACCESS);
         });
 
     }
@@ -282,18 +282,18 @@ public class StoreEndpointUnitTest extends BaseUnitTest {
     /* ## GENERIC TEST CASES                                                                            ## */
     /* ################################################################################################### */
 
-    protected QueryDto persist_generic(Long containerId, Long databaseId, Database database, Long queryId, Query query,
+    protected QueryDto persist_generic(Long databaseId, Database database, Long queryId, Query query,
                                        String username, User user, Principal principal, DatabaseAccess access)
             throws DatabaseNotFoundException, UserNotFoundException, QueryStoreException, QueryNotFoundException,
             ImageNotSupportedException, NotAllowedException, DatabaseConnectionException,
             QueryAlreadyPersistedException {
 
         /* mock */
-        when(databaseService.find(containerId, databaseId))
+        when(databaseService.find(databaseId))
                 .thenReturn(database);
-        when(storeService.findOne(containerId, databaseId, queryId, principal))
+        when(storeService.findOne(databaseId, queryId, principal))
                 .thenReturn(query);
-        when(storeService.persist(containerId, databaseId, queryId, principal))
+        when(storeService.persist(databaseId, queryId, principal))
                 .thenReturn(query);
         if (access != null) {
             log.trace("mock access for database with id {} and username {}", databaseId, username);
@@ -308,24 +308,24 @@ public class StoreEndpointUnitTest extends BaseUnitTest {
                 .thenReturn(Optional.of(user));
 
         /* test */
-        final ResponseEntity<QueryDto> response = storeEndpoint.persist(containerId, databaseId, queryId, principal);
+        final ResponseEntity<QueryDto> response = storeEndpoint.persist(databaseId, queryId, principal);
         assertEquals(HttpStatus.ACCEPTED, response.getStatusCode());
         assertNotNull(response.getBody());
         return response.getBody();
     }
 
-    protected void findAll_generic(Long containerId, Long databaseId, Database database, Principal principal)
+    protected void findAll_generic(Long databaseId, Database database, Principal principal)
             throws UserNotFoundException, QueryStoreException, DatabaseConnectionException, TableMalformedException,
             DatabaseNotFoundException, ImageNotSupportedException, ContainerNotFoundException, NotAllowedException {
 
         /* mock */
         doReturn(List.of(QUERY_1)).when(storeService)
-                .findAll(containerId, databaseId, true, principal);
-        when(databaseService.find(containerId, databaseId))
+                .findAll(databaseId, true, principal);
+        when(databaseService.find(databaseId))
                 .thenReturn(database);
 
         /* test */
-        final ResponseEntity<List<QueryBriefDto>> response = storeEndpoint.findAll(containerId, databaseId, true, principal);
+        final ResponseEntity<List<QueryBriefDto>> response = storeEndpoint.findAll(databaseId, true, principal);
         assertEquals(HttpStatus.OK, response.getStatusCode());
         assertNotNull(response.getBody());
         assertEquals(1, response.getBody().size());
@@ -334,24 +334,24 @@ public class StoreEndpointUnitTest extends BaseUnitTest {
         assertEquals(QUERY_1_STATEMENT, query.getQuery());
     }
 
-    protected QueryDto find_generic(Long containerId, Long databaseId, Database database, Long queryId, Query query,
+    protected QueryDto find_generic(Long databaseId, Database database, Long queryId, Query query,
                                     String username, User user, Principal principal) throws QueryStoreException,
             QueryNotFoundException, DatabaseNotFoundException, ImageNotSupportedException, UserNotFoundException,
             NotAllowedException, DatabaseConnectionException {
 
         /* mock */
         if (query != null) {
-            when(storeService.findOne(containerId, databaseId, queryId, principal))
+            when(storeService.findOne(databaseId, queryId, principal))
                     .thenReturn(query);
         } else {
-            when(storeService.findOne(containerId, databaseId, queryId, principal))
+            when(storeService.findOne(databaseId, queryId, principal))
                     .thenThrow(QueryNotFoundException.class);
         }
         if (database != null) {
-            when(databaseService.find(containerId, databaseId))
+            when(databaseService.find(databaseId))
                     .thenReturn(database);
         } else {
-            when(databaseService.find(containerId, databaseId))
+            when(databaseService.find(databaseId))
                     .thenThrow(DatabaseNotFoundException.class);
         }
         if (user != null) {
@@ -363,7 +363,7 @@ public class StoreEndpointUnitTest extends BaseUnitTest {
         }
 
         /* test */
-        final ResponseEntity<QueryDto> response = storeEndpoint.find(containerId, databaseId, queryId, principal);
+        final ResponseEntity<QueryDto> response = storeEndpoint.find(databaseId, queryId, principal);
         assertEquals(HttpStatus.OK, response.getStatusCode());
         final QueryDto body = response.getBody();
         assertNotNull(body);
diff --git a/dbrepo-query-service/rest-service/src/test/java/at/tuwien/endpoint/TableDataEndpointUnitTest.java b/dbrepo-query-service/rest-service/src/test/java/at/tuwien/endpoint/TableDataEndpointUnitTest.java
index 0374aae586..7974925bb0 100644
--- a/dbrepo-query-service/rest-service/src/test/java/at/tuwien/endpoint/TableDataEndpointUnitTest.java
+++ b/dbrepo-query-service/rest-service/src/test/java/at/tuwien/endpoint/TableDataEndpointUnitTest.java
@@ -12,7 +12,6 @@ import at.tuwien.entities.database.DatabaseAccess;
 import at.tuwien.entities.database.table.Table;
 import at.tuwien.exception.*;
 import at.tuwien.gateway.BrokerServiceGateway;
-import at.tuwien.listener.MessageQueueListener;
 import at.tuwien.listener.impl.RabbitMqListenerImpl;
 import at.tuwien.repository.sdb.ViewIdxRepository;
 import at.tuwien.service.AccessService;
@@ -41,7 +40,7 @@ import java.time.Instant;
 import java.util.stream.Stream;
 
 import static org.junit.jupiter.api.Assertions.*;
-import static org.mockito.Mockito.*;
+import static org.mockito.Mockito.when;
 
 @Log4j2
 @SpringBootTest
@@ -87,7 +86,7 @@ public class TableDataEndpointUnitTest extends BaseUnitTest {
 
         /* test */
         assertThrows(AccessDeniedException.class, () -> {
-            generic_import(CONTAINER_1_ID, DATABASE_1_ID, DATABASE_1, TABLE_1_ID, TABLE_1, null, null, null);
+            generic_import(DATABASE_1_ID, DATABASE_1, TABLE_1_ID, TABLE_1, null, null, null);
         });
     }
 
@@ -97,7 +96,7 @@ public class TableDataEndpointUnitTest extends BaseUnitTest {
 
         /* test */
         assertThrows(AccessDeniedException.class, () -> {
-            generic_import(CONTAINER_1_ID, DATABASE_1_ID, DATABASE_1, TABLE_1_ID, TABLE_1, USER_2_USERNAME,
+            generic_import(DATABASE_1_ID, DATABASE_1, TABLE_1_ID, TABLE_1, USER_2_USERNAME,
                     DATABASE_1_USER_1_READ_ACCESS, USER_2_PRINCIPAL);
         });
     }
@@ -108,7 +107,7 @@ public class TableDataEndpointUnitTest extends BaseUnitTest {
 
         /* test */
         assertThrows(AccessDeniedException.class, () -> {
-            generic_import(CONTAINER_1_ID, DATABASE_1_ID, DATABASE_1, TABLE_1_ID, TABLE_1, USER_2_USERNAME,
+            generic_import(DATABASE_1_ID, DATABASE_1, TABLE_1_ID, TABLE_1, USER_2_USERNAME,
                     DATABASE_1_USER_1_WRITE_OWN_ACCESS, USER_2_PRINCIPAL);
         });
     }
@@ -119,7 +118,7 @@ public class TableDataEndpointUnitTest extends BaseUnitTest {
 
         /* test */
         assertThrows(AccessDeniedException.class, () -> {
-            generic_import(CONTAINER_2_ID, DATABASE_2_ID, DATABASE_2, TABLE_1_ID, TABLE_1, null, null, null);
+            generic_import(DATABASE_2_ID, DATABASE_2, TABLE_1_ID, TABLE_1, null, null, null);
         });
     }
 
@@ -129,7 +128,7 @@ public class TableDataEndpointUnitTest extends BaseUnitTest {
 
         /* test */
         assertThrows(AccessDeniedException.class, () -> {
-            generic_import(CONTAINER_2_ID, DATABASE_2_ID, DATABASE_2, TABLE_1_ID, TABLE_1, USER_2_USERNAME,
+            generic_import(DATABASE_2_ID, DATABASE_2, TABLE_1_ID, TABLE_1, USER_2_USERNAME,
                     DATABASE_2_USER_1_READ_ACCESS, USER_2_PRINCIPAL);
         });
     }
@@ -140,7 +139,7 @@ public class TableDataEndpointUnitTest extends BaseUnitTest {
 
         /* test */
         assertThrows(AccessDeniedException.class, () -> {
-            generic_import(CONTAINER_2_ID, DATABASE_2_ID, DATABASE_2, TABLE_1_ID, TABLE_1, USER_2_USERNAME,
+            generic_import(DATABASE_2_ID, DATABASE_2, TABLE_1_ID, TABLE_1, USER_2_USERNAME,
                     DATABASE_2_USER_1_WRITE_OWN_ACCESS, USER_2_PRINCIPAL);
         });
     }
@@ -151,7 +150,7 @@ public class TableDataEndpointUnitTest extends BaseUnitTest {
 
         /* test */
         assertThrows(AccessDeniedException.class, () -> {
-            generic_import(CONTAINER_3_ID, DATABASE_3_ID, DATABASE_3, TABLE_8_ID, TABLE_8, null, null, null);
+            generic_import(DATABASE_3_ID, DATABASE_3, TABLE_8_ID, TABLE_8, null, null, null);
         });
     }
 
@@ -162,7 +161,7 @@ public class TableDataEndpointUnitTest extends BaseUnitTest {
             ImageNotSupportedException, ContainerNotFoundException {
 
         /* test */
-        generic_import(CONTAINER_3_ID, DATABASE_3_ID, DATABASE_3, TABLE_8_ID, TABLE_8, USER_1_USERNAME,
+        generic_import(DATABASE_3_ID, DATABASE_3, TABLE_8_ID, TABLE_8, USER_1_USERNAME,
                 DATABASE_3_USER_1_WRITE_ALL_ACCESS, USER_1_PRINCIPAL);
     }
 
@@ -173,7 +172,7 @@ public class TableDataEndpointUnitTest extends BaseUnitTest {
             ImageNotSupportedException, ContainerNotFoundException {
 
         /* test */
-        generic_import(CONTAINER_1_ID, DATABASE_1_ID, DATABASE_1, TABLE_1_ID, TABLE_1, USER_1_USERNAME,
+        generic_import(DATABASE_1_ID, DATABASE_1, TABLE_1_ID, TABLE_1, USER_1_USERNAME,
                 DATABASE_1_USER_1_WRITE_ALL_ACCESS, USER_1_PRINCIPAL);
     }
 
@@ -183,7 +182,7 @@ public class TableDataEndpointUnitTest extends BaseUnitTest {
 
         /* test */
         assertThrows(AccessDeniedException.class, () -> {
-            generic_insert(CONTAINER_1_ID, DATABASE_1_ID, TABLE_1_ID, DATABASE_1, TABLE_1, USER_2_USERNAME, null,
+            generic_insert(DATABASE_1_ID, TABLE_1_ID, DATABASE_1, TABLE_1, USER_2_USERNAME, null,
                     TABLE_1_CSV_DTO, null);
         });
     }
@@ -194,7 +193,7 @@ public class TableDataEndpointUnitTest extends BaseUnitTest {
 
         /* test */
         assertThrows(AccessDeniedException.class, () -> {
-            generic_insert(CONTAINER_1_ID, DATABASE_1_ID, TABLE_1_ID, DATABASE_1, TABLE_1, USER_2_USERNAME,
+            generic_insert(DATABASE_1_ID, TABLE_1_ID, DATABASE_1, TABLE_1, USER_2_USERNAME,
                     DATABASE_1_USER_1_READ_ACCESS, TABLE_1_CSV_DTO, USER_2_PRINCIPAL);
         });
     }
@@ -205,7 +204,7 @@ public class TableDataEndpointUnitTest extends BaseUnitTest {
 
         /* test */
         assertThrows(AccessDeniedException.class, () -> {
-            generic_insert(CONTAINER_1_ID, DATABASE_1_ID, TABLE_1_ID, DATABASE_1, TABLE_1, USER_2_USERNAME,
+            generic_insert(DATABASE_1_ID, TABLE_1_ID, DATABASE_1, TABLE_1, USER_2_USERNAME,
                     DATABASE_1_USER_1_WRITE_OWN_ACCESS, TABLE_1_CSV_DTO, USER_2_PRINCIPAL);
         });
     }
@@ -216,7 +215,7 @@ public class TableDataEndpointUnitTest extends BaseUnitTest {
 
         /* test */
         assertThrows(AccessDeniedException.class, () -> {
-            generic_insert(CONTAINER_2_ID, DATABASE_2_ID, TABLE_1_ID, DATABASE_2, TABLE_1, USER_2_USERNAME, null,
+            generic_insert(DATABASE_2_ID, TABLE_1_ID, DATABASE_2, TABLE_1, USER_2_USERNAME, null,
                     TABLE_1_CSV_DTO, null);
         });
     }
@@ -227,7 +226,7 @@ public class TableDataEndpointUnitTest extends BaseUnitTest {
 
         /* test */
         assertThrows(AccessDeniedException.class, () -> {
-            generic_insert(CONTAINER_2_ID, DATABASE_2_ID, TABLE_1_ID, DATABASE_2, TABLE_1, USER_2_USERNAME,
+            generic_insert(DATABASE_2_ID, TABLE_1_ID, DATABASE_2, TABLE_1, USER_2_USERNAME,
                     DATABASE_2_USER_1_READ_ACCESS, TABLE_1_CSV_DTO, USER_2_PRINCIPAL);
         });
     }
@@ -238,7 +237,7 @@ public class TableDataEndpointUnitTest extends BaseUnitTest {
 
         /* test */
         assertThrows(AccessDeniedException.class, () -> {
-            generic_insert(CONTAINER_2_ID, DATABASE_2_ID, TABLE_1_ID, DATABASE_2, TABLE_1, USER_2_USERNAME,
+            generic_insert(DATABASE_2_ID, TABLE_1_ID, DATABASE_2, TABLE_1, USER_2_USERNAME,
                     DATABASE_2_USER_1_WRITE_OWN_ACCESS, TABLE_1_CSV_DTO, USER_2_PRINCIPAL);
         });
     }
@@ -250,7 +249,7 @@ public class TableDataEndpointUnitTest extends BaseUnitTest {
             ImageNotSupportedException, ContainerNotFoundException {
 
         /* test */
-        generic_insert(CONTAINER_3_ID, DATABASE_3_ID, TABLE_8_ID, DATABASE_3, TABLE_8, USER_1_USERNAME,
+        generic_insert(DATABASE_3_ID, TABLE_8_ID, DATABASE_3, TABLE_8, USER_1_USERNAME,
                 DATABASE_3_USER_1_WRITE_ALL_ACCESS, TABLE_8_CSV_DTO, USER_1_PRINCIPAL);
     }
 
@@ -261,7 +260,7 @@ public class TableDataEndpointUnitTest extends BaseUnitTest {
             ImageNotSupportedException, ContainerNotFoundException {
 
         /* test */
-        generic_insert(CONTAINER_1_ID, DATABASE_1_ID, TABLE_1_ID, DATABASE_1, TABLE_1, USER_1_USERNAME,
+        generic_insert(DATABASE_1_ID, TABLE_1_ID, DATABASE_1, TABLE_1, USER_1_USERNAME,
                 DATABASE_1_USER_1_WRITE_ALL_ACCESS, TABLE_1_CSV_DTO, USER_1_PRINCIPAL);
     }
 
@@ -272,7 +271,7 @@ public class TableDataEndpointUnitTest extends BaseUnitTest {
             ImageNotSupportedException, ContainerNotFoundException {
 
         /* test */
-        generic_insert(CONTAINER_1_ID, DATABASE_1_ID, TABLE_1_ID, DATABASE_1, TABLE_1, USER_1_USERNAME,
+        generic_insert(DATABASE_1_ID, TABLE_1_ID, DATABASE_1, TABLE_1, USER_1_USERNAME,
                 DATABASE_1_USER_1_WRITE_ALL_ACCESS, null, USER_1_PRINCIPAL);
     }
 
@@ -282,7 +281,7 @@ public class TableDataEndpointUnitTest extends BaseUnitTest {
 
         /* test */
         assertThrows(PaginationException.class, () -> {
-            generic_getAll(CONTAINER_3_ID, DATABASE_3_ID, TABLE_8_ID, DATABASE_3, TABLE_8, null, null, null, null, null,
+            generic_getAll(DATABASE_3_ID, TABLE_8_ID, DATABASE_3, TABLE_8, null, null, null, null, null,
                     3L, null, null);
         });
     }
@@ -293,7 +292,7 @@ public class TableDataEndpointUnitTest extends BaseUnitTest {
 
         /* test */
         assertThrows(PaginationException.class, () -> {
-            generic_getAll(CONTAINER_3_ID, DATABASE_3_ID, TABLE_8_ID, DATABASE_3, TABLE_8, null, null, null, null, 3L,
+            generic_getAll(DATABASE_3_ID, TABLE_8_ID, DATABASE_3, TABLE_8, null, null, null, null, 3L,
                     null, null, null);
         });
     }
@@ -304,7 +303,7 @@ public class TableDataEndpointUnitTest extends BaseUnitTest {
 
         /* test */
         assertThrows(PaginationException.class, () -> {
-            generic_getAll(CONTAINER_3_ID, DATABASE_3_ID, TABLE_8_ID, DATABASE_3, TABLE_8, null, null, null, null, -3L,
+            generic_getAll(DATABASE_3_ID, TABLE_8_ID, DATABASE_3, TABLE_8, null, null, null, null, -3L,
                     3L, null, null);
         });
     }
@@ -315,7 +314,7 @@ public class TableDataEndpointUnitTest extends BaseUnitTest {
 
         /* test */
         assertThrows(PaginationException.class, () -> {
-            generic_getAll(CONTAINER_3_ID, DATABASE_3_ID, TABLE_8_ID, DATABASE_3, TABLE_8, null, null, null, null, 3L,
+            generic_getAll(DATABASE_3_ID, TABLE_8_ID, DATABASE_3, TABLE_8, null, null, null, null, 3L,
                     -3L, null, null);
         });
     }
@@ -326,7 +325,7 @@ public class TableDataEndpointUnitTest extends BaseUnitTest {
 
         /* test */
         assertThrows(PaginationException.class, () -> {
-            generic_getAll(CONTAINER_3_ID, DATABASE_3_ID, TABLE_8_ID, DATABASE_3, TABLE_8, null, null, null, null, 0L,
+            generic_getAll(DATABASE_3_ID, TABLE_8_ID, DATABASE_3, TABLE_8, null, null, null, null, 0L,
                     0L, null, null);
         });
     }
@@ -337,7 +336,7 @@ public class TableDataEndpointUnitTest extends BaseUnitTest {
 
         /* test */
         assertThrows(NotAllowedException.class, () -> {
-            generic_getAll(CONTAINER_1_ID, DATABASE_1_ID, TABLE_1_ID, DATABASE_1, TABLE_1, null, null, null, null, null, null, null, null);
+            generic_getAll(DATABASE_1_ID, TABLE_1_ID, DATABASE_1, TABLE_1, null, null, null, null, null, null, null, null);
         });
     }
 
@@ -347,7 +346,7 @@ public class TableDataEndpointUnitTest extends BaseUnitTest {
 
         /* test */
         assertThrows(NotAllowedException.class, () -> {
-            generic_getAll(CONTAINER_1_ID, DATABASE_1_ID, TABLE_1_ID, DATABASE_1, TABLE_1, USER_4_USERNAME, DATABASE_1_USER_1_READ_ACCESS, USER_4_PRINCIPAL, null, null, null, null, null);
+            generic_getAll(DATABASE_1_ID, TABLE_1_ID, DATABASE_1, TABLE_1, USER_4_USERNAME, DATABASE_1_USER_1_READ_ACCESS, USER_4_PRINCIPAL, null, null, null, null, null);
         });
     }
 
@@ -357,31 +356,31 @@ public class TableDataEndpointUnitTest extends BaseUnitTest {
 
         /* test */
         assertThrows(NotAllowedException.class, () -> {
-            generic_getCount(CONTAINER_1_ID, DATABASE_1_ID, TABLE_1_ID, DATABASE_1, TABLE_1, USER_4_USERNAME, DATABASE_1_USER_1_READ_ACCESS, USER_4_PRINCIPAL, null);
+            generic_getCount(DATABASE_1_ID, TABLE_1_ID, DATABASE_1, TABLE_1, USER_4_USERNAME, DATABASE_1_USER_1_READ_ACCESS, USER_4_PRINCIPAL, null);
         });
     }
 
     public static Stream<Arguments> getAll_succeeds_parameters() {
         return Stream.of(
-                Arguments.arguments("public anonymous", CONTAINER_3_ID, DATABASE_3_ID, TABLE_8_ID, DATABASE_3,
+                Arguments.arguments("public anonymous", DATABASE_3_ID, TABLE_8_ID, DATABASE_3,
                         TABLE_8, null, null, null,
                         null, null, null, null, null),
-                Arguments.arguments("public read", CONTAINER_3_ID, DATABASE_3_ID, TABLE_8_ID, DATABASE_3, TABLE_8,
+                Arguments.arguments("public read", DATABASE_3_ID, TABLE_8_ID, DATABASE_3, TABLE_8,
                         USER_1_USERNAME,
                         DATABASE_3_USER_1_READ_ACCESS, USER_1_PRINCIPAL, null, null, null, null, null),
-                Arguments.arguments("public write-own", CONTAINER_3_ID, DATABASE_3_ID, TABLE_8_ID, DATABASE_3,
+                Arguments.arguments("public write-own", DATABASE_3_ID, TABLE_8_ID, DATABASE_3,
                         TABLE_8, USER_1_USERNAME,
                         DATABASE_3_USER_1_WRITE_OWN_ACCESS, USER_1_PRINCIPAL, null, null, null, null, null),
-                Arguments.arguments("public write-all", CONTAINER_3_ID, DATABASE_3_ID, TABLE_8_ID, DATABASE_3,
+                Arguments.arguments("public write-all", DATABASE_3_ID, TABLE_8_ID, DATABASE_3,
                         TABLE_8, USER_1_USERNAME,
                         DATABASE_3_USER_1_WRITE_ALL_ACCESS, USER_1_PRINCIPAL, null, null, null, null, null),
-                Arguments.arguments("private read", CONTAINER_1_ID, DATABASE_1_ID, TABLE_1_ID, DATABASE_1, TABLE_1,
+                Arguments.arguments("private read", DATABASE_1_ID, TABLE_1_ID, DATABASE_1, TABLE_1,
                         USER_1_USERNAME,
                         DATABASE_1_USER_1_READ_ACCESS, USER_1_PRINCIPAL, null, null, null, null, null),
-                Arguments.arguments("private write-own", CONTAINER_1_ID, DATABASE_1_ID, TABLE_1_ID, DATABASE_1,
+                Arguments.arguments("private write-own", DATABASE_1_ID, TABLE_1_ID, DATABASE_1,
                         TABLE_1, USER_1_USERNAME,
                         DATABASE_1_USER_1_WRITE_OWN_ACCESS, USER_1_PRINCIPAL, null, null, null, null, null),
-                Arguments.arguments("private write-all", CONTAINER_1_ID, DATABASE_1_ID, TABLE_1_ID, DATABASE_1,
+                Arguments.arguments("private write-all", DATABASE_1_ID, TABLE_1_ID, DATABASE_1,
                         TABLE_1, USER_1_USERNAME,
                         DATABASE_1_USER_1_WRITE_ALL_ACCESS, USER_1_PRINCIPAL, null, null, null, null, null)
         );
@@ -390,35 +389,35 @@ public class TableDataEndpointUnitTest extends BaseUnitTest {
     @ParameterizedTest
     @WithMockUser(username = USER_1_USERNAME, authorities = {"insert-table-data"})
     @MethodSource("getAll_succeeds_parameters")
-    public void getAll_succeeds(String test, Long containerId, Long databaseId, Long tableId, Database database,
+    public void getAll_succeeds(String test, Long databaseId, Long tableId, Database database,
                                 Table table, String username, DatabaseAccess access, Principal principal,
                                 Instant timestamp, Long page, Long size, SortType sortDirection, String sortColumn) throws UserNotFoundException, TableNotFoundException, QueryStoreException, SortException, TableMalformedException, NotAllowedException, DatabaseConnectionException, QueryMalformedException, DatabaseNotFoundException, ImageNotSupportedException, PaginationException, ContainerNotFoundException {
 
         /* test */
-        generic_getAll(containerId, databaseId, tableId, database, table, username, access, principal, timestamp,
+        generic_getAll(databaseId, tableId, database, table, username, access, principal, timestamp,
                 page, size, sortDirection, sortColumn);
     }
 
     public static Stream<Arguments> getCount_succeeds_parameters() {
         return Stream.of(
-                Arguments.arguments("public anonymous", CONTAINER_3_ID, DATABASE_3_ID, TABLE_8_ID, DATABASE_3,
+                Arguments.arguments("public anonymous", DATABASE_3_ID, TABLE_8_ID, DATABASE_3,
                         TABLE_8, null, null, null, null),
-                Arguments.arguments("public read", CONTAINER_3_ID, DATABASE_3_ID, TABLE_8_ID, DATABASE_3, TABLE_8,
+                Arguments.arguments("public read", DATABASE_3_ID, TABLE_8_ID, DATABASE_3, TABLE_8,
                         USER_1_USERNAME,
                         DATABASE_3_USER_1_READ_ACCESS, USER_1_PRINCIPAL, null),
-                Arguments.arguments("public write-own", CONTAINER_3_ID, DATABASE_3_ID, TABLE_8_ID, DATABASE_3,
+                Arguments.arguments("public write-own", DATABASE_3_ID, TABLE_8_ID, DATABASE_3,
                         TABLE_8, USER_1_USERNAME,
                         DATABASE_3_USER_1_WRITE_OWN_ACCESS, USER_1_PRINCIPAL, null),
-                Arguments.arguments("public write-all", CONTAINER_3_ID, DATABASE_3_ID, TABLE_8_ID, DATABASE_3,
+                Arguments.arguments("public write-all", DATABASE_3_ID, TABLE_8_ID, DATABASE_3,
                         TABLE_8, USER_1_USERNAME,
                         DATABASE_3_USER_1_WRITE_ALL_ACCESS, USER_1_PRINCIPAL, null),
-                Arguments.arguments("private read", CONTAINER_1_ID, DATABASE_2_ID, TABLE_8_ID, DATABASE_2, TABLE_8,
+                Arguments.arguments("private read", DATABASE_2_ID, TABLE_8_ID, DATABASE_2, TABLE_8,
                         USER_1_USERNAME,
                         DATABASE_2_USER_1_READ_ACCESS, USER_1_PRINCIPAL, null),
-                Arguments.arguments("private write-own", CONTAINER_1_ID, DATABASE_2_ID, TABLE_8_ID, DATABASE_2,
+                Arguments.arguments("private write-own", DATABASE_2_ID, TABLE_8_ID, DATABASE_2,
                         TABLE_8, USER_2_USERNAME,
                         DATABASE_2_USER_1_WRITE_OWN_ACCESS, USER_2_PRINCIPAL, null),
-                Arguments.arguments("private write-all", CONTAINER_1_ID, DATABASE_2_ID, TABLE_8_ID, DATABASE_2,
+                Arguments.arguments("private write-all", DATABASE_2_ID, TABLE_8_ID, DATABASE_2,
                         TABLE_8, USER_2_USERNAME,
                         DATABASE_2_USER_1_WRITE_ALL_ACCESS, USER_2_PRINCIPAL, null)
         );
@@ -427,12 +426,12 @@ public class TableDataEndpointUnitTest extends BaseUnitTest {
     @ParameterizedTest
     @WithMockUser(username = USER_1_USERNAME, authorities = {"insert-table-data"})
     @MethodSource("getAll_succeeds_parameters")
-    public void getCount_succeeds(String test, Long containerId, Long databaseId, Long tableId, Database database,
+    public void getCount_succeeds(String test, Long databaseId, Long tableId, Database database,
                                   Table table, String username, DatabaseAccess access, Principal principal,
                                   Instant timestamp) throws UserNotFoundException, TableNotFoundException, QueryStoreException, SortException, TableMalformedException, NotAllowedException, DatabaseConnectionException, QueryMalformedException, DatabaseNotFoundException, ImageNotSupportedException, PaginationException, ContainerNotFoundException {
 
         /* test */
-        generic_getCount(containerId, databaseId, tableId, database, table, username, access, principal, timestamp);
+        generic_getCount(databaseId, tableId, database, table, username, access, principal, timestamp);
     }
 
 
@@ -440,47 +439,47 @@ public class TableDataEndpointUnitTest extends BaseUnitTest {
     /* ## GENERIC TEST CASES                                                                            ## */
     /* ################################################################################################### */
 
-    public void generic_import(Long containerId, Long databaseId, Database database, Long tableId, Table table,
+    public void generic_import(Long databaseId, Database database, Long tableId, Table table,
                                String username, DatabaseAccess access, Principal principal) throws DatabaseNotFoundException, TableNotFoundException, NotAllowedException, UserNotFoundException, TableMalformedException, DatabaseConnectionException, QueryMalformedException, ImageNotSupportedException, ContainerNotFoundException {
         final ImportDto request = ImportDto.builder().location("test:csv/csv_01.csv").build();
 
         /* mock */
-        when(databaseService.find(containerId, databaseId)).thenReturn(database);
-        when(tableService.find(containerId, databaseId, tableId)).thenReturn(table);
+        when(databaseService.find(databaseId)).thenReturn(database);
+        when(tableService.find(databaseId, tableId)).thenReturn(table);
         when(accessService.find(databaseId, username)).thenReturn(access);
 
         /* test */
-        final ResponseEntity<?> response = dataEndpoint.importCsv(containerId, databaseId, tableId, request, principal);
+        final ResponseEntity<?> response = dataEndpoint.importCsv(databaseId, tableId, request, principal);
         assertNotNull(response);
         assertEquals(HttpStatus.ACCEPTED, response.getStatusCode());
     }
 
-    public void generic_insert(Long containerId, Long databaseId, Long tableId, Database database, Table table,
+    public void generic_insert(Long databaseId, Long tableId, Database database, Table table,
                                String username, DatabaseAccess access, TableCsvDto data, Principal principal) throws DatabaseNotFoundException, TableNotFoundException, NotAllowedException, UserNotFoundException, TableMalformedException, DatabaseConnectionException, ImageNotSupportedException, ContainerNotFoundException {
 
         /* mock */
-        when(databaseService.find(containerId, databaseId)).thenReturn(database);
-        when(tableService.find(containerId, databaseId, tableId)).thenReturn(table);
+        when(databaseService.find(databaseId)).thenReturn(database);
+        when(tableService.find(databaseId, tableId)).thenReturn(table);
         when(accessService.find(databaseId, username)).thenReturn(access);
 
         /* test */
-        final ResponseEntity<?> response = dataEndpoint.insert(containerId, databaseId, tableId, data, principal);
+        final ResponseEntity<?> response = dataEndpoint.insert(databaseId, tableId, data, principal);
         assertNotNull(response);
         assertEquals(HttpStatus.ACCEPTED, response.getStatusCode());
     }
 
-    public void generic_getAll(Long containerId, Long databaseId, Long tableId, Database database, Table table,
+    public void generic_getAll(Long databaseId, Long tableId, Database database, Table table,
                                String username, DatabaseAccess access, Principal principal, Instant timestamp,
                                Long page, Long size, SortType sortDirection, String sortColumn) throws UserNotFoundException, TableMalformedException, NotAllowedException, PaginationException, TableNotFoundException, QueryStoreException, SortException, DatabaseConnectionException, QueryMalformedException, DatabaseNotFoundException, ImageNotSupportedException, ContainerNotFoundException {
 
         /* mock */
-        when(databaseService.find(containerId, databaseId)).thenReturn(database);
-        when(tableService.find(containerId, databaseId, tableId)).thenReturn(table);
+        when(databaseService.find(databaseId)).thenReturn(database);
+        when(tableService.find(databaseId, tableId)).thenReturn(table);
         when(accessService.find(databaseId, username)).thenReturn(access);
-        when(queryService.tableFindAll(containerId, databaseId, tableId, timestamp, page, size, principal)).thenReturn(QUERY_1_RESULT_DTO);
+        when(queryService.tableFindAll(databaseId, tableId, timestamp, page, size, principal)).thenReturn(QUERY_1_RESULT_DTO);
 
         /* test */
-        final ResponseEntity<QueryResultDto> response = dataEndpoint.getAll(containerId, databaseId, tableId,
+        final ResponseEntity<QueryResultDto> response = dataEndpoint.getAll(databaseId, tableId,
                 principal, timestamp, page, size, sortDirection, sortColumn);
         assertEquals(HttpStatus.OK, response.getStatusCode());
         assertNotNull(response.getBody());
@@ -489,17 +488,17 @@ public class TableDataEndpointUnitTest extends BaseUnitTest {
         assertEquals(QUERY_1_RESULT_RESULT, response.getBody().getResult());
     }
 
-    public void generic_getCount(Long containerId, Long databaseId, Long tableId, Database database, Table table,
+    public void generic_getCount(Long databaseId, Long tableId, Database database, Table table,
                                  String username, DatabaseAccess access, Principal principal, Instant timestamp) throws UserNotFoundException, TableMalformedException, NotAllowedException, PaginationException, TableNotFoundException, QueryStoreException, SortException, DatabaseConnectionException, QueryMalformedException, DatabaseNotFoundException, ImageNotSupportedException, ContainerNotFoundException {
 
         /* mock */
-        when(databaseService.find(containerId, databaseId)).thenReturn(database);
-        when(tableService.find(containerId, databaseId, tableId)).thenReturn(table);
+        when(databaseService.find(databaseId)).thenReturn(database);
+        when(tableService.find(databaseId, tableId)).thenReturn(table);
         when(accessService.find(databaseId, username)).thenReturn(access);
-        when(queryService.tableCount(containerId, databaseId, tableId, timestamp, principal)).thenReturn(QUERY_1_RESULT_NUMBER);
+        when(queryService.tableCount(databaseId, tableId, timestamp, principal)).thenReturn(QUERY_1_RESULT_NUMBER);
 
         /* test */
-        final ResponseEntity<Long> response = dataEndpoint.getCount(containerId, databaseId, tableId,
+        final ResponseEntity<Long> response = dataEndpoint.getCount(databaseId, tableId,
                 principal, timestamp);
         assertEquals(HttpStatus.OK, response.getStatusCode());
         assertNotNull(response.getBody());
diff --git a/dbrepo-query-service/rest-service/src/test/java/at/tuwien/endpoint/TableHistoryEndpointUnitTest.java b/dbrepo-query-service/rest-service/src/test/java/at/tuwien/endpoint/TableHistoryEndpointUnitTest.java
index 3a32885368..35349d54b0 100644
--- a/dbrepo-query-service/rest-service/src/test/java/at/tuwien/endpoint/TableHistoryEndpointUnitTest.java
+++ b/dbrepo-query-service/rest-service/src/test/java/at/tuwien/endpoint/TableHistoryEndpointUnitTest.java
@@ -32,7 +32,8 @@ import java.security.Principal;
 import java.util.List;
 import java.util.Optional;
 
-import static org.junit.jupiter.api.Assertions.*;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 import static org.mockito.Mockito.when;
 
 @Log4j2
@@ -79,7 +80,7 @@ public class TableHistoryEndpointUnitTest extends BaseUnitTest {
             DatabaseNotFoundException {
 
         /* test */
-        data_generic(CONTAINER_1_ID, DATABASE_1_ID, DATABASE_1, TABLE_1_ID, TABLE_1, null, null, null);
+        data_generic(DATABASE_1_ID, DATABASE_1, TABLE_1_ID, TABLE_1, null, null, null);
     }
 
     @Test
@@ -89,7 +90,7 @@ public class TableHistoryEndpointUnitTest extends BaseUnitTest {
             DatabaseNotFoundException {
 
         /* test */
-        data_generic(CONTAINER_1_ID, DATABASE_1_ID, DATABASE_1, TABLE_1_ID, TABLE_1, null, null, null);
+        data_generic(DATABASE_1_ID, DATABASE_1, TABLE_1_ID, TABLE_1, null, null, null);
     }
 
     @Test
@@ -99,7 +100,7 @@ public class TableHistoryEndpointUnitTest extends BaseUnitTest {
             DatabaseNotFoundException {
 
         /* test */
-        data_generic(CONTAINER_1_ID, DATABASE_1_ID, DATABASE_1, TABLE_1_ID, TABLE_1, USER_1_USERNAME, USER_1_PRINCIPAL, DATABASE_1_USER_1_READ_ACCESS);
+        data_generic(DATABASE_1_ID, DATABASE_1, TABLE_1_ID, TABLE_1, USER_1_USERNAME, USER_1_PRINCIPAL, DATABASE_1_USER_1_READ_ACCESS);
     }
 
     @Test
@@ -109,22 +110,22 @@ public class TableHistoryEndpointUnitTest extends BaseUnitTest {
             DatabaseNotFoundException {
 
         /* test */
-        data_generic(CONTAINER_2_ID, DATABASE_2_ID, DATABASE_2, TABLE_4_ID, TABLE_4, USER_1_USERNAME, USER_1_PRINCIPAL, null);
+        data_generic(DATABASE_2_ID, DATABASE_2, TABLE_4_ID, TABLE_4, USER_1_USERNAME, USER_1_PRINCIPAL, null);
     }
 
     /* ################################################################################################### */
     /* ## GENERIC TEST CASES                                                                            ## */
     /* ################################################################################################### */
 
-    protected void data_generic(Long containerId, Long databaseId, Database database, Long tableId, Table table,
+    protected void data_generic(Long databaseId, Database database, Long tableId, Table table,
                                 String username, Principal principal, DatabaseAccess access)
             throws DatabaseNotFoundException, UserNotFoundException, NotAllowedException, DatabaseConnectionException,
             QueryMalformedException, QueryStoreException, TableNotFoundException {
 
         /* mock */
-        when(databaseService.find(containerId, databaseId))
+        when(databaseService.find(databaseId))
                 .thenReturn(database);
-        when(tableService.find(containerId, databaseId, tableId))
+        when(tableService.find(databaseId, tableId))
                 .thenReturn(table);
         if (access != null) {
             when(databaseAccessRepository.findByDatabaseIdAndUsername(databaseId, username))
@@ -135,7 +136,7 @@ public class TableHistoryEndpointUnitTest extends BaseUnitTest {
         }
 
         /* test */
-        final ResponseEntity<List<TableHistoryDto>> response = tableHistoryEndpoint.getAll(containerId, databaseId, tableId, principal);
+        final ResponseEntity<List<TableHistoryDto>> response = tableHistoryEndpoint.getAll(databaseId, tableId, principal);
         assertEquals(HttpStatus.OK, response.getStatusCode());
         assertNotNull(response.getBody());
     }
diff --git a/dbrepo-query-service/rest-service/src/test/java/at/tuwien/endpoint/ViewEndpointUnitTest.java b/dbrepo-query-service/rest-service/src/test/java/at/tuwien/endpoint/ViewEndpointUnitTest.java
index 9644e2113a..80687a7330 100644
--- a/dbrepo-query-service/rest-service/src/test/java/at/tuwien/endpoint/ViewEndpointUnitTest.java
+++ b/dbrepo-query-service/rest-service/src/test/java/at/tuwien/endpoint/ViewEndpointUnitTest.java
@@ -4,7 +4,6 @@ import at.tuwien.BaseUnitTest;
 import at.tuwien.api.database.ViewBriefDto;
 import at.tuwien.api.database.ViewCreateDto;
 import at.tuwien.api.database.ViewDto;
-import at.tuwien.api.database.query.ExecuteStatementDto;
 import at.tuwien.api.database.query.QueryResultDto;
 import at.tuwien.config.IndexConfig;
 import at.tuwien.config.ReadyConfig;
@@ -12,7 +11,6 @@ import at.tuwien.entities.database.Database;
 import at.tuwien.entities.database.DatabaseAccess;
 import at.tuwien.exception.*;
 import at.tuwien.gateway.BrokerServiceGateway;
-import at.tuwien.listener.MessageQueueListener;
 import at.tuwien.listener.impl.RabbitMqListenerImpl;
 import at.tuwien.repository.sdb.ViewIdxRepository;
 import at.tuwien.service.AccessService;
@@ -84,7 +82,7 @@ public class ViewEndpointUnitTest extends BaseUnitTest {
             DatabaseNotFoundException {
 
         /* test */
-        findAll_generic(CONTAINER_3_ID, DATABASE_3_ID, DATABASE_3, null, null, null);
+        findAll_generic(DATABASE_3_ID, DATABASE_3, null, null, null);
     }
 
     @Test
@@ -93,7 +91,7 @@ public class ViewEndpointUnitTest extends BaseUnitTest {
             DatabaseNotFoundException {
 
         /* test */
-        findAll_generic(CONTAINER_3_ID, DATABASE_3_ID, DATABASE_3, USER_2_USERNAME, USER_2_PRINCIPAL, null);
+        findAll_generic(DATABASE_3_ID, DATABASE_3, USER_2_USERNAME, USER_2_PRINCIPAL, null);
     }
 
     @Test
@@ -102,7 +100,7 @@ public class ViewEndpointUnitTest extends BaseUnitTest {
             DatabaseNotFoundException {
 
         /* test */
-        findAll_generic(CONTAINER_3_ID, DATABASE_3_ID, DATABASE_3, USER_2_USERNAME, USER_2_PRINCIPAL, DATABASE_3_USER_2_READ_ACCESS);
+        findAll_generic(DATABASE_3_ID, DATABASE_3, USER_2_USERNAME, USER_2_PRINCIPAL, DATABASE_3_USER_2_READ_ACCESS);
     }
 
     @Test
@@ -111,7 +109,7 @@ public class ViewEndpointUnitTest extends BaseUnitTest {
             DatabaseNotFoundException {
 
         /* test */
-        findAll_generic(CONTAINER_3_ID, DATABASE_3_ID, DATABASE_3, USER_2_USERNAME, USER_2_PRINCIPAL, null);
+        findAll_generic(DATABASE_3_ID, DATABASE_3, USER_2_USERNAME, USER_2_PRINCIPAL, null);
     }
 
     @Test
@@ -120,7 +118,7 @@ public class ViewEndpointUnitTest extends BaseUnitTest {
 
         /* test */
         assertThrows(AccessDeniedException.class, () -> {
-            create_generic(CONTAINER_3_ID, DATABASE_3_ID, DATABASE_3, null, null, null);
+            create_generic(DATABASE_3_ID, DATABASE_3, null, null, null);
         });
     }
 
@@ -130,7 +128,7 @@ public class ViewEndpointUnitTest extends BaseUnitTest {
 
         /* test */
         assertThrows(NotAllowedException.class, () -> {
-            create_generic(CONTAINER_3_ID, DATABASE_3_ID, DATABASE_3, USER_2_USERNAME, USER_2_PRINCIPAL, null);
+            create_generic(DATABASE_3_ID, DATABASE_3, USER_2_USERNAME, USER_2_PRINCIPAL, null);
         });
     }
 
@@ -140,7 +138,7 @@ public class ViewEndpointUnitTest extends BaseUnitTest {
 
         /* test */
         assertThrows(NotAllowedException.class, () -> {
-            create_generic(CONTAINER_3_ID, DATABASE_3_ID, DATABASE_3, USER_2_USERNAME, USER_2_PRINCIPAL, DATABASE_2_USER_1_READ_ACCESS);
+            create_generic(DATABASE_3_ID, DATABASE_3, USER_2_USERNAME, USER_2_PRINCIPAL, DATABASE_2_USER_1_READ_ACCESS);
         });
     }
 
@@ -150,7 +148,7 @@ public class ViewEndpointUnitTest extends BaseUnitTest {
 
         /* test */
         assertThrows(AccessDeniedException.class, () -> {
-            create_generic(CONTAINER_3_ID, DATABASE_3_ID, DATABASE_3, USER_2_USERNAME, USER_2_PRINCIPAL, null);
+            create_generic(DATABASE_3_ID, DATABASE_3, USER_2_USERNAME, USER_2_PRINCIPAL, null);
         });
     }
 
@@ -160,7 +158,7 @@ public class ViewEndpointUnitTest extends BaseUnitTest {
             DatabaseNotFoundException, ViewNotFoundException {
 
         /* test */
-        find_generic(CONTAINER_3_ID, DATABASE_3_ID, VIEW_1_ID, DATABASE_3, null, null, null);
+        find_generic(DATABASE_3_ID, VIEW_1_ID, DATABASE_3, null, null, null);
     }
 
     @Test
@@ -169,7 +167,7 @@ public class ViewEndpointUnitTest extends BaseUnitTest {
             DatabaseNotFoundException, ViewNotFoundException {
 
         /* test */
-        find_generic(CONTAINER_3_ID, DATABASE_3_ID, VIEW_1_ID, DATABASE_3, USER_2_USERNAME, USER_2_PRINCIPAL, DATABASE_2_USER_1_READ_ACCESS);
+        find_generic(DATABASE_3_ID, VIEW_1_ID, DATABASE_3, USER_2_USERNAME, USER_2_PRINCIPAL, DATABASE_2_USER_1_READ_ACCESS);
     }
 
     @Test
@@ -178,7 +176,7 @@ public class ViewEndpointUnitTest extends BaseUnitTest {
             DatabaseNotFoundException, ViewNotFoundException {
 
         /* test */
-        find_generic(CONTAINER_3_ID, DATABASE_3_ID, VIEW_1_ID, DATABASE_3, USER_2_USERNAME, USER_2_PRINCIPAL, DATABASE_2_USER_1_READ_ACCESS);
+        find_generic(DATABASE_3_ID, VIEW_1_ID, DATABASE_3, USER_2_USERNAME, USER_2_PRINCIPAL, DATABASE_2_USER_1_READ_ACCESS);
     }
 
     @Test
@@ -187,7 +185,7 @@ public class ViewEndpointUnitTest extends BaseUnitTest {
             DatabaseNotFoundException, ViewNotFoundException {
 
         /* test */
-        find_generic(CONTAINER_3_ID, DATABASE_3_ID, VIEW_1_ID, DATABASE_3, USER_2_USERNAME, USER_2_PRINCIPAL, DATABASE_2_USER_1_READ_ACCESS);
+        find_generic(DATABASE_3_ID, VIEW_1_ID, DATABASE_3, USER_2_USERNAME, USER_2_PRINCIPAL, DATABASE_2_USER_1_READ_ACCESS);
     }
 
     @Test
@@ -196,7 +194,7 @@ public class ViewEndpointUnitTest extends BaseUnitTest {
 
         /* test */
         assertThrows(AccessDeniedException.class, () -> {
-            delete_generic(CONTAINER_3_ID, DATABASE_3_ID, VIEW_1_ID, DATABASE_3, null, null, null);
+            delete_generic(DATABASE_3_ID, VIEW_1_ID, DATABASE_3, null, null, null);
         });
     }
 
@@ -206,7 +204,7 @@ public class ViewEndpointUnitTest extends BaseUnitTest {
 
         /* test */
         assertThrows(NotAllowedException.class, () -> {
-            delete_generic(CONTAINER_3_ID, DATABASE_3_ID, VIEW_1_ID, DATABASE_3, USER_2_USERNAME, USER_2_PRINCIPAL, DATABASE_2_USER_1_READ_ACCESS);
+            delete_generic(DATABASE_3_ID, VIEW_1_ID, DATABASE_3, USER_2_USERNAME, USER_2_PRINCIPAL, DATABASE_2_USER_1_READ_ACCESS);
         });
     }
 
@@ -216,7 +214,7 @@ public class ViewEndpointUnitTest extends BaseUnitTest {
 
         /* test */
         assertThrows(AccessDeniedException.class, () -> {
-            delete_generic(CONTAINER_3_ID, DATABASE_3_ID, VIEW_1_ID, DATABASE_3, USER_2_USERNAME, USER_2_PRINCIPAL, DATABASE_2_USER_1_READ_ACCESS);
+            delete_generic(DATABASE_3_ID, VIEW_1_ID, DATABASE_3, USER_2_USERNAME, USER_2_PRINCIPAL, DATABASE_2_USER_1_READ_ACCESS);
         });
     }
 
@@ -227,7 +225,7 @@ public class ViewEndpointUnitTest extends BaseUnitTest {
             QueryMalformedException {
 
         /* test */
-        delete_generic(CONTAINER_3_ID, DATABASE_3_ID, VIEW_5_ID, DATABASE_3, USER_3_USERNAME, USER_3_PRINCIPAL, DATABASE_3_USER_1_WRITE_ALL_ACCESS);
+        delete_generic(DATABASE_3_ID, VIEW_5_ID, DATABASE_3, USER_3_USERNAME, USER_3_PRINCIPAL, DATABASE_3_USER_1_WRITE_ALL_ACCESS);
     }
 
     @Test
@@ -238,7 +236,7 @@ public class ViewEndpointUnitTest extends BaseUnitTest {
             ContainerNotFoundException, PaginationException, ViewMalformedException {
 
         /* test */
-        data_generic(CONTAINER_3_ID, DATABASE_3_ID, VIEW_1_ID, DATABASE_3, null, null, null);
+        data_generic(DATABASE_3_ID, VIEW_1_ID, DATABASE_3, null, null, null);
     }
 
     @Test
@@ -249,7 +247,7 @@ public class ViewEndpointUnitTest extends BaseUnitTest {
             ContainerNotFoundException, PaginationException, ViewMalformedException {
 
         /* test */
-        data_generic(CONTAINER_3_ID, DATABASE_3_ID, VIEW_1_ID, DATABASE_3, USER_2_USERNAME, USER_2_PRINCIPAL, DATABASE_2_USER_1_READ_ACCESS);
+        data_generic(DATABASE_3_ID, VIEW_1_ID, DATABASE_3, USER_2_USERNAME, USER_2_PRINCIPAL, DATABASE_2_USER_1_READ_ACCESS);
     }
 
     @Test
@@ -260,7 +258,7 @@ public class ViewEndpointUnitTest extends BaseUnitTest {
             ContainerNotFoundException, PaginationException, ViewMalformedException {
 
         /* test */
-        data_generic(CONTAINER_3_ID, DATABASE_3_ID, VIEW_1_ID, DATABASE_3, USER_2_USERNAME, USER_2_PRINCIPAL, DATABASE_2_USER_1_READ_ACCESS);
+        data_generic(DATABASE_3_ID, VIEW_1_ID, DATABASE_3, USER_2_USERNAME, USER_2_PRINCIPAL, DATABASE_2_USER_1_READ_ACCESS);
     }
 
     @Test
@@ -271,7 +269,7 @@ public class ViewEndpointUnitTest extends BaseUnitTest {
             ContainerNotFoundException, PaginationException, ViewMalformedException {
 
         /* test */
-        data_generic(CONTAINER_3_ID, DATABASE_3_ID, VIEW_1_ID, DATABASE_3, USER_2_USERNAME, USER_2_PRINCIPAL, DATABASE_2_USER_1_READ_ACCESS);
+        data_generic(DATABASE_3_ID, VIEW_1_ID, DATABASE_3, USER_2_USERNAME, USER_2_PRINCIPAL, DATABASE_2_USER_1_READ_ACCESS);
     }
 
     /* ################################################################################################### */
@@ -284,7 +282,7 @@ public class ViewEndpointUnitTest extends BaseUnitTest {
             DatabaseNotFoundException {
 
         /* test */
-        findAll_generic(CONTAINER_1_ID, DATABASE_1_ID, DATABASE_1, null, null, null);
+        findAll_generic(DATABASE_1_ID, DATABASE_1, null, null, null);
     }
 
     @Test
@@ -293,7 +291,7 @@ public class ViewEndpointUnitTest extends BaseUnitTest {
             DatabaseNotFoundException {
 
         /* test */
-        findAll_generic(CONTAINER_1_ID, DATABASE_1_ID, DATABASE_1, USER_2_USERNAME, USER_2_PRINCIPAL, null);
+        findAll_generic(DATABASE_1_ID, DATABASE_1, USER_2_USERNAME, USER_2_PRINCIPAL, null);
     }
 
     @Test
@@ -302,7 +300,7 @@ public class ViewEndpointUnitTest extends BaseUnitTest {
             DatabaseNotFoundException {
 
         /* test */
-        findAll_generic(CONTAINER_1_ID, DATABASE_1_ID, DATABASE_1, USER_2_USERNAME, USER_2_PRINCIPAL, DATABASE_1_USER_2_READ_ACCESS);
+        findAll_generic(DATABASE_1_ID, DATABASE_1, USER_2_USERNAME, USER_2_PRINCIPAL, DATABASE_1_USER_2_READ_ACCESS);
     }
 
     @Test
@@ -311,7 +309,7 @@ public class ViewEndpointUnitTest extends BaseUnitTest {
             DatabaseNotFoundException {
 
         /* test */
-        findAll_generic(CONTAINER_1_ID, DATABASE_1_ID, DATABASE_1, USER_2_USERNAME, USER_2_PRINCIPAL, null);
+        findAll_generic(DATABASE_1_ID, DATABASE_1, USER_2_USERNAME, USER_2_PRINCIPAL, null);
     }
 
     @Test
@@ -320,7 +318,7 @@ public class ViewEndpointUnitTest extends BaseUnitTest {
 
         /* test */
         assertThrows(AccessDeniedException.class, () -> {
-            create_generic(CONTAINER_1_ID, DATABASE_1_ID, DATABASE_1, null, null, null);
+            create_generic(DATABASE_1_ID, DATABASE_1, null, null, null);
         });
     }
 
@@ -330,7 +328,7 @@ public class ViewEndpointUnitTest extends BaseUnitTest {
 
         /* test */
         assertThrows(NotAllowedException.class, () -> {
-            create_generic(CONTAINER_1_ID, DATABASE_1_ID, DATABASE_1, USER_2_USERNAME, USER_2_PRINCIPAL, null);
+            create_generic(DATABASE_1_ID, DATABASE_1, USER_2_USERNAME, USER_2_PRINCIPAL, null);
         });
     }
 
@@ -340,7 +338,7 @@ public class ViewEndpointUnitTest extends BaseUnitTest {
 
         /* test */
         assertThrows(NotAllowedException.class, () -> {
-            create_generic(CONTAINER_1_ID, DATABASE_1_ID, DATABASE_1, USER_2_USERNAME, USER_2_PRINCIPAL, DATABASE_2_USER_1_READ_ACCESS);
+            create_generic(DATABASE_1_ID, DATABASE_1, USER_2_USERNAME, USER_2_PRINCIPAL, DATABASE_2_USER_1_READ_ACCESS);
         });
     }
 
@@ -350,7 +348,7 @@ public class ViewEndpointUnitTest extends BaseUnitTest {
 
         /* test */
         assertThrows(AccessDeniedException.class, () -> {
-            create_generic(CONTAINER_1_ID, DATABASE_1_ID, DATABASE_1, USER_2_USERNAME, USER_2_PRINCIPAL, null);
+            create_generic(DATABASE_1_ID, DATABASE_1, USER_2_USERNAME, USER_2_PRINCIPAL, null);
         });
     }
 
@@ -360,7 +358,7 @@ public class ViewEndpointUnitTest extends BaseUnitTest {
             DatabaseNotFoundException, ViewNotFoundException {
 
         /* test */
-        find_generic(CONTAINER_1_ID, DATABASE_1_ID, VIEW_1_ID, DATABASE_1, null, null, null);
+        find_generic(DATABASE_1_ID, VIEW_1_ID, DATABASE_1, null, null, null);
     }
 
     @Test
@@ -369,7 +367,7 @@ public class ViewEndpointUnitTest extends BaseUnitTest {
             DatabaseNotFoundException, ViewNotFoundException {
 
         /* test */
-        find_generic(CONTAINER_1_ID, DATABASE_1_ID, VIEW_1_ID, DATABASE_1, USER_2_USERNAME, USER_2_PRINCIPAL, DATABASE_2_USER_1_READ_ACCESS);
+        find_generic(DATABASE_1_ID, VIEW_1_ID, DATABASE_1, USER_2_USERNAME, USER_2_PRINCIPAL, DATABASE_2_USER_1_READ_ACCESS);
     }
 
     @Test
@@ -378,7 +376,7 @@ public class ViewEndpointUnitTest extends BaseUnitTest {
             DatabaseNotFoundException, ViewNotFoundException {
 
         /* test */
-        find_generic(CONTAINER_1_ID, DATABASE_1_ID, VIEW_1_ID, DATABASE_1, USER_2_USERNAME, USER_2_PRINCIPAL, DATABASE_2_USER_1_READ_ACCESS);
+        find_generic(DATABASE_1_ID, VIEW_1_ID, DATABASE_1, USER_2_USERNAME, USER_2_PRINCIPAL, DATABASE_2_USER_1_READ_ACCESS);
     }
 
     @Test
@@ -387,7 +385,7 @@ public class ViewEndpointUnitTest extends BaseUnitTest {
             DatabaseNotFoundException, ViewNotFoundException {
 
         /* test */
-        find_generic(CONTAINER_1_ID, DATABASE_1_ID, VIEW_1_ID, DATABASE_1, USER_2_USERNAME, USER_2_PRINCIPAL, DATABASE_2_USER_1_READ_ACCESS);
+        find_generic(DATABASE_1_ID, VIEW_1_ID, DATABASE_1, USER_2_USERNAME, USER_2_PRINCIPAL, DATABASE_2_USER_1_READ_ACCESS);
     }
 
     @Test
@@ -396,7 +394,7 @@ public class ViewEndpointUnitTest extends BaseUnitTest {
 
         /* test */
         assertThrows(AccessDeniedException.class, () -> {
-            delete_generic(CONTAINER_1_ID, DATABASE_1_ID, VIEW_1_ID, DATABASE_1, null, null, null);
+            delete_generic(DATABASE_1_ID, VIEW_1_ID, DATABASE_1, null, null, null);
         });
     }
 
@@ -406,7 +404,7 @@ public class ViewEndpointUnitTest extends BaseUnitTest {
 
         /* test */
         assertThrows(NotAllowedException.class, () -> {
-            delete_generic(CONTAINER_1_ID, DATABASE_1_ID, VIEW_1_ID, DATABASE_1, USER_2_USERNAME, USER_2_PRINCIPAL, DATABASE_2_USER_1_READ_ACCESS);
+            delete_generic(DATABASE_1_ID, VIEW_1_ID, DATABASE_1, USER_2_USERNAME, USER_2_PRINCIPAL, DATABASE_2_USER_1_READ_ACCESS);
         });
     }
 
@@ -416,7 +414,7 @@ public class ViewEndpointUnitTest extends BaseUnitTest {
 
         /* test */
         assertThrows(AccessDeniedException.class, () -> {
-            delete_generic(CONTAINER_1_ID, DATABASE_1_ID, VIEW_1_ID, DATABASE_1, USER_2_USERNAME, USER_2_PRINCIPAL, DATABASE_2_USER_1_READ_ACCESS);
+            delete_generic(DATABASE_1_ID, VIEW_1_ID, DATABASE_1, USER_2_USERNAME, USER_2_PRINCIPAL, DATABASE_2_USER_1_READ_ACCESS);
         });
     }
 
@@ -427,7 +425,7 @@ public class ViewEndpointUnitTest extends BaseUnitTest {
             QueryMalformedException {
 
         /* test */
-        delete_generic(CONTAINER_1_ID, DATABASE_1_ID, VIEW_1_ID, DATABASE_1, USER_1_USERNAME, USER_1_PRINCIPAL, DATABASE_1_USER_1_WRITE_ALL_ACCESS);
+        delete_generic(DATABASE_1_ID, VIEW_1_ID, DATABASE_1, USER_1_USERNAME, USER_1_PRINCIPAL, DATABASE_1_USER_1_WRITE_ALL_ACCESS);
     }
 
     @Test
@@ -436,7 +434,7 @@ public class ViewEndpointUnitTest extends BaseUnitTest {
 
         /* test */
         assertThrows(NotAllowedException.class, () -> {
-            data_generic(CONTAINER_1_ID, DATABASE_1_ID, VIEW_1_ID, DATABASE_1, null, null, null);
+            data_generic(DATABASE_1_ID, VIEW_1_ID, DATABASE_1, null, null, null);
         });
     }
 
@@ -448,7 +446,7 @@ public class ViewEndpointUnitTest extends BaseUnitTest {
             ContainerNotFoundException, PaginationException, ViewMalformedException {
 
         /* test */
-        data_generic(CONTAINER_1_ID, DATABASE_1_ID, VIEW_1_ID, DATABASE_1, USER_2_USERNAME, USER_2_PRINCIPAL, DATABASE_2_USER_1_READ_ACCESS);
+        data_generic(DATABASE_1_ID, VIEW_1_ID, DATABASE_1, USER_2_USERNAME, USER_2_PRINCIPAL, DATABASE_2_USER_1_READ_ACCESS);
     }
 
     @Test
@@ -459,7 +457,7 @@ public class ViewEndpointUnitTest extends BaseUnitTest {
             ContainerNotFoundException, PaginationException, ViewMalformedException {
 
         /* test */
-        data_generic(CONTAINER_1_ID, DATABASE_1_ID, VIEW_1_ID, DATABASE_1, USER_2_USERNAME, USER_2_PRINCIPAL, DATABASE_2_USER_1_READ_ACCESS);
+        data_generic(DATABASE_1_ID, VIEW_1_ID, DATABASE_1, USER_2_USERNAME, USER_2_PRINCIPAL, DATABASE_2_USER_1_READ_ACCESS);
     }
 
     @Test
@@ -470,19 +468,19 @@ public class ViewEndpointUnitTest extends BaseUnitTest {
             ContainerNotFoundException, PaginationException, ViewMalformedException {
 
         /* test */
-        data_generic(CONTAINER_1_ID, DATABASE_1_ID, VIEW_1_ID, DATABASE_1, USER_2_USERNAME, USER_2_PRINCIPAL, DATABASE_2_USER_1_READ_ACCESS);
+        data_generic(DATABASE_1_ID, VIEW_1_ID, DATABASE_1, USER_2_USERNAME, USER_2_PRINCIPAL, DATABASE_2_USER_1_READ_ACCESS);
     }
 
     /* ################################################################################################### */
     /* ## GENERIC TEST CASES                                                                            ## */
     /* ################################################################################################### */
 
-    protected void findAll_generic(Long containerId, Long databaseId, Database database, String username,
+    protected void findAll_generic(Long databaseId, Database database, String username,
                                    Principal principal, DatabaseAccess access) throws UserNotFoundException,
             NotAllowedException, DatabaseNotFoundException {
 
         /* mock */
-        when(databaseService.find(containerId, databaseId))
+        when(databaseService.find(databaseId))
                 .thenReturn(database);
         if (access != null) {
             log.trace("mock access of database with id {} and username {}", databaseId, username);
@@ -499,7 +497,7 @@ public class ViewEndpointUnitTest extends BaseUnitTest {
         }
 
         /* test */
-        final ResponseEntity<List<ViewBriefDto>> response = viewEndpoint.findAll(containerId, databaseId, principal);
+        final ResponseEntity<List<ViewBriefDto>> response = viewEndpoint.findAll(databaseId, principal);
         assertEquals(HttpStatus.OK, response.getStatusCode());
         assertNotNull(response.getBody());
         if (access == null) {
@@ -509,7 +507,7 @@ public class ViewEndpointUnitTest extends BaseUnitTest {
         }
     }
 
-    protected void create_generic(Long containerId, Long databaseId, Database database, String username,
+    protected void create_generic(Long databaseId, Database database, String username,
                                   Principal principal, DatabaseAccess access) throws DatabaseNotFoundException,
             UserNotFoundException, DatabaseConnectionException, ViewMalformedException, QueryMalformedException,
             NotAllowedException {
@@ -520,7 +518,7 @@ public class ViewEndpointUnitTest extends BaseUnitTest {
                 .build();
 
         /* mock */
-        when(databaseService.find(containerId, databaseId))
+        when(databaseService.find(databaseId))
                 .thenReturn(database);
         if (access != null) {
             log.trace("mock access of database with id {} and username {}", databaseId, username);
@@ -531,23 +529,23 @@ public class ViewEndpointUnitTest extends BaseUnitTest {
             when(accessService.find(databaseId, username))
                     .thenThrow(NotAllowedException.class);
         }
-        when(viewService.create(containerId, databaseId, request, principal))
+        when(viewService.create(databaseId, request, principal))
                 .thenReturn(VIEW_1);
 
         /* test */
-        final ResponseEntity<ViewBriefDto> response = viewEndpoint.create(containerId, databaseId, request, principal);
+        final ResponseEntity<ViewBriefDto> response = viewEndpoint.create(databaseId, request, principal);
         assertEquals(HttpStatus.CREATED, response.getStatusCode());
         assertNotNull(response.getBody());
         assertEquals(VIEW_1_ID, response.getBody().getId());
         assertEquals(VIEW_1_NAME, response.getBody().getName());
     }
 
-    protected void find_generic(Long containerId, Long databaseId, Long viewId, Database database, String username,
+    protected void find_generic(Long databaseId, Long viewId, Database database, String username,
                                 Principal principal, DatabaseAccess access) throws DatabaseNotFoundException,
             UserNotFoundException, NotAllowedException, ViewNotFoundException {
 
         /* mock */
-        when(databaseService.find(containerId, databaseId))
+        when(databaseService.find(databaseId))
                 .thenReturn(database);
         if (access != null) {
             log.trace("mock access of database with id {} and username {}", databaseId, username);
@@ -562,20 +560,20 @@ public class ViewEndpointUnitTest extends BaseUnitTest {
                 .thenReturn(VIEW_1);
 
         /* test */
-        final ResponseEntity<ViewDto> response = viewEndpoint.find(containerId, databaseId, viewId, principal);
+        final ResponseEntity<ViewDto> response = viewEndpoint.find(databaseId, viewId, principal);
         assertEquals(HttpStatus.OK, response.getStatusCode());
         assertNotNull(response.getBody());
         assertEquals(VIEW_1_ID, response.getBody().getId());
         assertEquals(VIEW_1_NAME, response.getBody().getName());
     }
 
-    protected void delete_generic(Long containerId, Long databaseId, Long viewId, Database database, String username,
+    protected void delete_generic(Long databaseId, Long viewId, Database database, String username,
                                   Principal principal, DatabaseAccess access) throws DatabaseNotFoundException,
             UserNotFoundException, NotAllowedException, ViewNotFoundException, DatabaseConnectionException,
             ViewMalformedException, QueryMalformedException {
 
         /* mock */
-        when(databaseService.find(containerId, databaseId))
+        when(databaseService.find(databaseId))
                 .thenReturn(database);
         if (access != null) {
             log.trace("mock access of database with id {} and username {}", databaseId, username);
@@ -588,14 +586,14 @@ public class ViewEndpointUnitTest extends BaseUnitTest {
         }
         doNothing()
                 .when(viewService)
-                .delete(containerId, databaseId, viewId, principal);
+                .delete(databaseId, viewId, principal);
 
         /* test */
-        final ResponseEntity<?> response = viewEndpoint.delete(containerId, databaseId, viewId, principal);
+        final ResponseEntity<?> response = viewEndpoint.delete(databaseId, viewId, principal);
         assertEquals(HttpStatus.ACCEPTED, response.getStatusCode());
     }
 
-    protected void data_generic(Long containerId, Long databaseId, Long viewId, Database database, String username,
+    protected void data_generic(Long databaseId, Long viewId, Database database, String username,
                                 Principal principal, DatabaseAccess access) throws DatabaseNotFoundException,
             UserNotFoundException, NotAllowedException, ViewNotFoundException, DatabaseConnectionException,
             QueryMalformedException, QueryStoreException, TableMalformedException, ColumnParseException,
@@ -604,7 +602,7 @@ public class ViewEndpointUnitTest extends BaseUnitTest {
         final Long size = 2L;
 
         /* mock */
-        when(databaseService.find(containerId, databaseId))
+        when(databaseService.find(databaseId))
                 .thenReturn(database);
         if (access != null) {
             log.trace("mock access of database with id {} and username {}", databaseId, username);
@@ -617,11 +615,11 @@ public class ViewEndpointUnitTest extends BaseUnitTest {
         }
         when(viewService.findById(databaseId, viewId, principal))
                 .thenReturn(VIEW_1);
-        when(queryService.viewFindAll(containerId, databaseId, VIEW_1, page, size, principal))
+        when(queryService.viewFindAll(databaseId, VIEW_1, page, size, principal))
                 .thenReturn(QUERY_1_RESULT_DTO);
 
         /* test */
-        final ResponseEntity<QueryResultDto> response = viewEndpoint.data(containerId, databaseId, viewId, principal, page, size);
+        final ResponseEntity<QueryResultDto> response = viewEndpoint.data(databaseId, viewId, principal, page, size);
         assertEquals(HttpStatus.OK, response.getStatusCode());
         assertNotNull(response.getBody());
         assertEquals(QUERY_1_RESULT_ID, response.getBody().getId());
diff --git a/dbrepo-query-service/rest-service/src/test/java/at/tuwien/listener/RabbitMqListenerIntegrationTest.java b/dbrepo-query-service/rest-service/src/test/java/at/tuwien/listener/RabbitMqListenerIntegrationTest.java
index 5acda1d8b2..6b14efdff8 100644
--- a/dbrepo-query-service/rest-service/src/test/java/at/tuwien/listener/RabbitMqListenerIntegrationTest.java
+++ b/dbrepo-query-service/rest-service/src/test/java/at/tuwien/listener/RabbitMqListenerIntegrationTest.java
@@ -2,14 +2,19 @@ package at.tuwien.listener;
 
 import at.tuwien.BaseUnitTest;
 import at.tuwien.api.amqp.ConsumerDto;
-import at.tuwien.config.*;
+import at.tuwien.config.AmqpConfig;
+import at.tuwien.config.IndexConfig;
+import at.tuwien.config.RabbitMqConfig;
+import at.tuwien.config.ReadyConfig;
 import at.tuwien.repository.mdb.*;
 import at.tuwien.repository.sdb.ViewIdxRepository;
 import com.rabbitmq.client.BuiltinExchangeType;
 import com.rabbitmq.client.Channel;
 import lombok.extern.log4j.Log4j2;
 import org.junit.Rule;
-import org.junit.jupiter.api.*;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.extension.ExtendWith;
 import org.junit.rules.Timeout;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -17,10 +22,15 @@ import org.springframework.boot.test.context.SpringBootTest;
 import org.springframework.boot.test.mock.mockito.MockBean;
 import org.springframework.test.annotation.DirtiesContext;
 import org.springframework.test.context.ActiveProfiles;
+import org.springframework.test.context.DynamicPropertyRegistry;
+import org.springframework.test.context.DynamicPropertySource;
 import org.springframework.test.context.junit.jupiter.SpringExtension;
+import org.testcontainers.containers.RabbitMQContainer;
+import org.testcontainers.junit.jupiter.Container;
+import org.testcontainers.junit.jupiter.Testcontainers;
 
 import java.io.IOException;
-import java.util.*;
+import java.util.List;
 import java.util.stream.Collectors;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -28,6 +38,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
 
 @Log4j2
 @ActiveProfiles(profiles = "junit")
+@Testcontainers
 @DirtiesContext(classMode = DirtiesContext.ClassMode.BEFORE_EACH_TEST_METHOD)
 @SpringBootTest
 @ExtendWith(SpringExtension.class)
@@ -63,9 +74,6 @@ public class RabbitMqListenerIntegrationTest extends BaseUnitTest {
     @Autowired
     private TableRepository tableRepository;
 
-    @Autowired
-    private H2Utils h2Utils;
-
     @Autowired
     private RabbitMqConfig rabbitMqConfig;
 
@@ -75,20 +83,17 @@ public class RabbitMqListenerIntegrationTest extends BaseUnitTest {
     @Rule
     public Timeout globalTimeout = Timeout.seconds(300);
 
-    @BeforeAll
-    public static void beforeAll() throws InterruptedException {
-        afterAll();
-        /* create networks */
-        DockerConfig.createAllNetworks();
-        /* create containers */
-        DockerConfig.createContainer(null, CONTAINER_BROKER, 15672, CONTAINER_BROKER_ENV);
-        DockerConfig.startContainer(CONTAINER_BROKER);
-    }
-
-    @AfterAll
-    public static void afterAll() {
-        DockerConfig.removeAllContainers();
-        DockerConfig.removeAllNetworks();
+    @Container
+    private static final RabbitMQContainer rabbitMQContainer = new RabbitMQContainer("rabbitmq:3-management-alpine")
+            .withVhost("/");
+
+    @DynamicPropertySource
+    static void rabbitMQProperties(DynamicPropertyRegistry registry) {
+        registry.add("fda.gateway.endpoint", () -> "http://" + rabbitMQContainer.getHost() + ":" + rabbitMQContainer.getHttpPort());
+        registry.add("spring.rabbitmq.host", rabbitMQContainer::getHost);
+        registry.add("spring.rabbitmq.port", rabbitMQContainer::getAmqpPort);
+        registry.add("spring.rabbitmq.username", rabbitMQContainer::getAdminUsername);
+        registry.add("spring.rabbitmq.password", rabbitMQContainer::getAdminPassword);
     }
 
     @BeforeEach
diff --git a/dbrepo-query-service/rest-service/src/test/java/at/tuwien/repository/ViewIdxRepositoryIntegrationTest.java b/dbrepo-query-service/rest-service/src/test/java/at/tuwien/repository/ViewIdxRepositoryIntegrationTest.java
index 1dd83a35bb..0cd9ef8c6b 100644
--- a/dbrepo-query-service/rest-service/src/test/java/at/tuwien/repository/ViewIdxRepositoryIntegrationTest.java
+++ b/dbrepo-query-service/rest-service/src/test/java/at/tuwien/repository/ViewIdxRepositoryIntegrationTest.java
@@ -3,40 +3,49 @@ package at.tuwien.repository;
 import at.tuwien.BaseUnitTest;
 import at.tuwien.api.database.ViewCreateDto;
 import at.tuwien.api.database.ViewDto;
+import at.tuwien.config.MariaDbConfig;
 import at.tuwien.config.ReadyConfig;
 import at.tuwien.entities.database.View;
 import at.tuwien.exception.*;
 import at.tuwien.gateway.BrokerServiceGateway;
 import at.tuwien.listener.impl.RabbitMqListenerImpl;
+import at.tuwien.repository.mdb.DatabaseRepository;
+import at.tuwien.repository.mdb.UserRepository;
+import at.tuwien.repository.mdb.ViewRepository;
 import at.tuwien.repository.sdb.ViewIdxRepository;
-import at.tuwien.repository.mdb.*;
 import at.tuwien.service.ViewService;
 import com.rabbitmq.client.Channel;
-import at.tuwien.config.DockerConfig;
 import lombok.extern.log4j.Log4j2;
 import org.junit.Rule;
-import org.junit.jupiter.api.AfterAll;
-import org.junit.jupiter.api.BeforeAll;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.extension.ExtendWith;
 import org.junit.rules.Timeout;
+import org.opensearch.testcontainers.OpensearchContainer;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.test.context.SpringBootTest;
 import org.springframework.boot.test.mock.mockito.MockBean;
 import org.springframework.test.annotation.DirtiesContext;
+import org.springframework.test.context.DynamicPropertyRegistry;
+import org.springframework.test.context.DynamicPropertySource;
 import org.springframework.test.context.junit.jupiter.SpringExtension;
+import org.testcontainers.containers.MariaDBContainer;
+import org.testcontainers.junit.jupiter.Container;
+import org.testcontainers.junit.jupiter.Testcontainers;
+import org.testcontainers.utility.DockerImageName;
 
-import java.io.File;
+import java.sql.SQLException;
 import java.util.List;
 import java.util.Optional;
 
-import static org.junit.jupiter.api.Assertions.*;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.when;
 
 
 @Log4j2
+@Testcontainers
 @DirtiesContext(classMode = DirtiesContext.ClassMode.BEFORE_EACH_TEST_METHOD)
 @SpringBootTest
 @ExtendWith(SpringExtension.class)
@@ -72,31 +81,26 @@ public class ViewIdxRepositoryIntegrationTest extends BaseUnitTest {
     @Rule
     public Timeout globalTimeout = Timeout.seconds(60);
 
-    static final String BIND_WEATHER = new File("../../dbrepo-metadata-db/test/src/test/resources/weather").toPath().toAbsolutePath() + ":/docker-entrypoint-initdb.d";
-
-    @BeforeAll
-    public static void beforeAll() throws InterruptedException {
-        afterAll();
-        /* create network */
-        DockerConfig.createAllNetworks();
-        /* create elastic search */
-        DockerConfig.createContainer(null, CONTAINER_ELASTIC, CONTAINER_ELASTIC_ENV);
-        DockerConfig.startContainer(CONTAINER_ELASTIC);
-        /* create container */
-        DockerConfig.createContainer(BIND_WEATHER, CONTAINER_1, CONTAINER_1_ENV);
-        DockerConfig.startContainer(CONTAINER_1);
-    }
+    @Container
+    @Autowired
+    private MariaDBContainer<?> mariaDBContainer;
+
+    @Container
+    private static final OpensearchContainer opensearchContainer = new OpensearchContainer(DockerImageName.parse("opensearchproject/opensearch:2"));
 
-    @AfterAll
-    public static void afterAll() {
-        DockerConfig.removeAllContainers();
-        DockerConfig.removeAllNetworks();
+    @DynamicPropertySource
+    static void elasticsearchProperties(DynamicPropertyRegistry registry) {
+        registry.add("spring.opensearch.uris", () -> opensearchContainer.getHttpHostAddress().substring(7));
+        registry.add("spring.opensearch.username", opensearchContainer::getUsername);
+        registry.add("spring.opensearch.password", opensearchContainer::getPassword);
     }
 
     @BeforeEach
-    public void beforeEach() {
+    public void beforeEach() throws SQLException {
         DATABASE_1.setTables(List.of(TABLE_1, TABLE_2, TABLE_3, TABLE_7));
         DATABASE_1.setViews(List.of(VIEW_1));
+        MariaDbConfig.dropAllDatabases(CONTAINER_1);
+        MariaDbConfig.createInitDatabase(CONTAINER_1, DATABASE_1);
     }
 
     @Test
@@ -109,7 +113,7 @@ public class ViewIdxRepositoryIntegrationTest extends BaseUnitTest {
                 .build();
 
         /* mock */
-        when(databaseRepository.findByContainerIdAndDatabaseId(CONTAINER_1_ID, DATABASE_1_ID))
+        when(databaseRepository.findByDatabaseId(DATABASE_1_ID))
                 .thenReturn(Optional.of(DATABASE_1));
         when(userRepository.findByUsername(USER_1_USERNAME))
                 .thenReturn(Optional.of(USER_1));
@@ -117,7 +121,7 @@ public class ViewIdxRepositoryIntegrationTest extends BaseUnitTest {
                 .thenReturn(VIEW_1);
 
         /* test */
-        viewService.create(CONTAINER_1_ID, DATABASE_1_ID, request, USER_1_PRINCIPAL);
+        viewService.create(DATABASE_1_ID, request, USER_1_PRINCIPAL);
         final Optional<ViewDto> response = viewIdxRepository.findById(VIEW_1_ID);
         assertTrue(response.isPresent());
         final ViewDto view = response.get();
@@ -125,7 +129,6 @@ public class ViewIdxRepositoryIntegrationTest extends BaseUnitTest {
         assertEquals(VIEW_1_NAME, view.getName());
         assertEquals(VIEW_1_INTERNAL_NAME, view.getInternalName());
         assertEquals(VIEW_1_QUERY, view.getQuery());
-        assertEquals(VIEW_1_CONTAINER_ID, view.getVdbid());
         assertEquals(VIEW_1_DATABASE_ID, view.getVdbid());
         assertEquals(VIEW_1_PUBLIC, view.getIsPublic());
     }
diff --git a/dbrepo-query-service/rest-service/src/test/java/at/tuwien/service/QueryServiceIntegrationTest.java b/dbrepo-query-service/rest-service/src/test/java/at/tuwien/service/QueryServiceIntegrationTest.java
index 7e8d87f806..29e390be4e 100644
--- a/dbrepo-query-service/rest-service/src/test/java/at/tuwien/service/QueryServiceIntegrationTest.java
+++ b/dbrepo-query-service/rest-service/src/test/java/at/tuwien/service/QueryServiceIntegrationTest.java
@@ -12,15 +12,15 @@ import at.tuwien.exception.*;
 import at.tuwien.gateway.BrokerServiceGateway;
 import at.tuwien.listener.impl.RabbitMqListenerImpl;
 import at.tuwien.querystore.Query;
-import at.tuwien.repository.mdb.*;
+import at.tuwien.repository.mdb.DatabaseRepository;
+import at.tuwien.repository.mdb.TableRepository;
+import at.tuwien.repository.mdb.UserRepository;
 import at.tuwien.repository.sdb.ViewIdxRepository;
 import com.rabbitmq.client.Channel;
-import at.tuwien.config.DockerConfig;
 import lombok.SneakyThrows;
 import lombok.extern.log4j.Log4j2;
-import org.junit.Rule;
-import org.junit.rules.Timeout;
-import org.junit.jupiter.api.*;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.extension.ExtendWith;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
@@ -29,8 +29,10 @@ import org.springframework.boot.test.context.SpringBootTest;
 import org.springframework.boot.test.mock.mockito.MockBean;
 import org.springframework.test.annotation.DirtiesContext;
 import org.springframework.test.context.junit.jupiter.SpringExtension;
+import org.testcontainers.containers.MariaDBContainer;
+import org.testcontainers.junit.jupiter.Container;
+import org.testcontainers.junit.jupiter.Testcontainers;
 
-import java.io.File;
 import java.math.BigInteger;
 import java.sql.SQLException;
 import java.time.Instant;
@@ -46,6 +48,7 @@ import static org.mockito.Mockito.when;
 
 
 @Log4j2
+@Testcontainers
 @DirtiesContext(classMode = DirtiesContext.ClassMode.BEFORE_EACH_TEST_METHOD)
 @EnableAutoConfiguration(exclude = RabbitAutoConfiguration.class)
 @SpringBootTest
@@ -82,18 +85,15 @@ public class QueryServiceIntegrationTest extends BaseUnitTest {
     @Autowired
     private QueryService queryService;
 
-    @Rule
-    public Timeout globalTimeout = Timeout.seconds(60);
-
-    private final static String BIND_WEATHER = new File("../../dbrepo-metadata-db/test/src/test/resources/weather").toPath().toAbsolutePath() + ":/docker-entrypoint-initdb.d";
-
-    private final static String BIND_ZOO = new File("../../dbrepo-metadata-db/test/src/test/resources/zoo").toPath().toAbsolutePath() + ":/docker-entrypoint-initdb.d";
+    @Container
+    @Autowired
+    private MariaDBContainer<?> mariaDBContainer;
 
     @BeforeEach
-    public void beforeEach() {
-        afterEach();
-        /* create network */
-        DockerConfig.createAllNetworks();
+    public void beforeEach() throws SQLException {
+        MariaDbConfig.dropAllDatabases(CONTAINER_1);
+        MariaDbConfig.createInitDatabase(CONTAINER_1, DATABASE_2);
+        MariaDbConfig.createInitDatabase(CONTAINER_1, DATABASE_1);
         /* metadata database */
         DATABASE_1.setTables(List.of(TABLE_1, TABLE_2, TABLE_3, TABLE_7));
         DATABASE_1.setViews(List.of(VIEW_2, VIEW_3));
@@ -101,28 +101,19 @@ public class QueryServiceIntegrationTest extends BaseUnitTest {
         DATABASE_2.setViews(List.of(VIEW_4));
     }
 
-    @AfterEach
-    public void afterEach() {
-        DockerConfig.removeAllContainers();
-        DockerConfig.removeAllNetworks();
-    }
-
     @Test
     public void findAll_succeeds() throws DatabaseNotFoundException, ImageNotSupportedException,
             TableMalformedException, TableNotFoundException, DatabaseConnectionException,
-            PaginationException, ContainerNotFoundException, QueryMalformedException, UserNotFoundException,
-            InterruptedException {
+            PaginationException, QueryMalformedException, UserNotFoundException {
 
         /* mock */
-        DockerConfig.createContainer(BIND_WEATHER, CONTAINER_1, CONTAINER_1_ENV);
-        DockerConfig.startContainer(CONTAINER_1);
-        when(databaseRepository.findByContainerIdAndDatabaseId(CONTAINER_1_ID, DATABASE_1_ID))
+        when(databaseRepository.findByDatabaseId(DATABASE_1_ID))
                 .thenReturn(Optional.of(DATABASE_1));
-        when(tableRepository.find(CONTAINER_1_ID, DATABASE_1_ID, TABLE_1_ID))
+        when(tableRepository.find(DATABASE_1_ID, TABLE_1_ID))
                 .thenReturn(Optional.of(TABLE_1));
 
         /* test */
-        final QueryResultDto result = queryService.tableFindAll(CONTAINER_1_ID, DATABASE_1_ID, TABLE_1_ID, Instant.now(),
+        final QueryResultDto result = queryService.tableFindAll(DATABASE_1_ID, TABLE_1_ID, Instant.now(),
                 null, null, USER_1_PRINCIPAL);
         assertEquals(3, result.getResult().size());
         assertEquals(BigInteger.valueOf(1L), result.getResult().get(0).get(COLUMN_1_1_INTERNAL_NAME));
@@ -145,65 +136,58 @@ public class QueryServiceIntegrationTest extends BaseUnitTest {
     @Test
     public void selectAll_succeeds() throws TableNotFoundException, DatabaseConnectionException,
             DatabaseNotFoundException, ImageNotSupportedException, TableMalformedException, PaginationException,
-            ContainerNotFoundException, QueryMalformedException, UserNotFoundException, InterruptedException {
+            QueryMalformedException, UserNotFoundException {
         final Long page = 0L;
         final Long size = 10L;
 
         /* mock */
-        DockerConfig.createContainer(BIND_WEATHER, CONTAINER_1, CONTAINER_1_ENV);
-        DockerConfig.startContainer(CONTAINER_1);
-        when(databaseRepository.findByContainerIdAndDatabaseId(CONTAINER_1_ID, DATABASE_1_ID))
+        when(databaseRepository.findByDatabaseId(DATABASE_1_ID))
                 .thenReturn(Optional.of(DATABASE_1));
-        when(tableRepository.find(CONTAINER_1_ID, DATABASE_1_ID, TABLE_1_ID))
+        when(tableRepository.find(DATABASE_1_ID, TABLE_1_ID))
                 .thenReturn(Optional.of(TABLE_1));
 
         /* test */
-        queryService.tableFindAll(CONTAINER_1_ID, DATABASE_1_ID, TABLE_1_ID, Instant.now(), page, size, USER_1_PRINCIPAL);
+        queryService.tableFindAll(DATABASE_1_ID, TABLE_1_ID, Instant.now(), page, size, USER_1_PRINCIPAL);
     }
 
     @Test
-    public void selectAll_noTable_fails() throws InterruptedException {
+    public void selectAll_noTable_fails() {
         final Long page = 0L;
         final Long size = 10L;
 
         /* mock */
-        DockerConfig.createContainer(BIND_WEATHER, CONTAINER_1, CONTAINER_1_ENV);
-        DockerConfig.startContainer(CONTAINER_1);
-        when(databaseRepository.findByContainerIdAndDatabaseId(CONTAINER_1_ID, DATABASE_1_ID))
+        when(databaseRepository.findByDatabaseId(DATABASE_1_ID))
                 .thenReturn(Optional.of(DATABASE_1));
-        when(tableRepository.find(CONTAINER_1_ID, DATABASE_1_ID, TABLE_1_ID))
+        when(tableRepository.find(DATABASE_1_ID, TABLE_1_ID))
                 .thenReturn(Optional.empty());
 
         /* test */
         assertThrows(TableNotFoundException.class, () -> {
-            queryService.tableFindAll(CONTAINER_1_ID, DATABASE_1_ID, TABLE_1_ID, Instant.now(), page, size, USER_1_PRINCIPAL);
+            queryService.tableFindAll(DATABASE_1_ID, TABLE_1_ID, Instant.now(), page, size, USER_1_PRINCIPAL);
         });
     }
 
     @Test
-    public void insert_columns_fails() throws InterruptedException {
+    public void insert_columns_fails() {
         final TableCsvDto request = TableCsvDto.builder()
                 .data(Map.of("key", "some_value"))
                 .build();
 
         /* mock */
-        DockerConfig.createContainer(BIND_WEATHER, CONTAINER_1, CONTAINER_1_ENV);
-        DockerConfig.startContainer(CONTAINER_1);
-        when(databaseRepository.findByContainerIdAndDatabaseId(CONTAINER_1_ID, DATABASE_1_ID))
+        when(databaseRepository.findByDatabaseId(DATABASE_1_ID))
                 .thenReturn(Optional.of(DATABASE_1));
-        when(tableRepository.find(CONTAINER_1_ID, DATABASE_1_ID, TABLE_1_ID))
+        when(tableRepository.find(DATABASE_1_ID, TABLE_1_ID))
                 .thenReturn(Optional.of(TABLE_1));
 
         /* test */
         assertThrows(TableMalformedException.class, () -> {
-            queryService.insert(CONTAINER_1_ID, DATABASE_1_ID, TABLE_1_ID, request, USER_1_PRINCIPAL);
+            queryService.insert(DATABASE_1_ID, TABLE_1_ID, request, USER_1_PRINCIPAL);
         });
     }
 
     @Test
-    public void insert_date_succeeds() throws InterruptedException, UserNotFoundException, TableNotFoundException,
-            TableMalformedException, DatabaseConnectionException, DatabaseNotFoundException, ImageNotSupportedException,
-            ContainerNotFoundException, SQLException {
+    public void insert_date_succeeds() throws UserNotFoundException, TableNotFoundException, TableMalformedException,
+            DatabaseConnectionException, DatabaseNotFoundException, ImageNotSupportedException, SQLException {
         final TableCsvDto request = TableCsvDto.builder()
                 .data(new HashMap<>() {{
                     put("id", 4L);
@@ -214,16 +198,14 @@ public class QueryServiceIntegrationTest extends BaseUnitTest {
                 }}).build();
 
         /* mock */
-        DockerConfig.createContainer(BIND_WEATHER, CONTAINER_1, CONTAINER_1_ENV);
-        DockerConfig.startContainer(CONTAINER_1);
-        when(databaseRepository.findByContainerIdAndDatabaseId(CONTAINER_1_ID, DATABASE_1_ID))
+        when(databaseRepository.findByDatabaseId(DATABASE_1_ID))
                 .thenReturn(Optional.of(DATABASE_1));
-        when(tableRepository.find(CONTAINER_1_ID, DATABASE_1_ID, TABLE_1_ID))
+        when(tableRepository.find(DATABASE_1_ID, TABLE_1_ID))
                 .thenReturn(Optional.of(TABLE_1));
 
         /* test */
-        queryService.insert(CONTAINER_1_ID, DATABASE_1_ID, TABLE_1_ID, request, USER_1_PRINCIPAL);
-        final List<Map<String, String>> response = MariaDbConfig.selectQuery(CONTAINER_1_INTERNALNAME, DATABASE_1_INTERNALNAME, "SELECT `id`, `date`, `location` FROM `weather_aus` WHERE `id` = 4", "id", "date", "location");
+        queryService.insert(DATABASE_1_ID, TABLE_1_ID, request, USER_1_PRINCIPAL);
+        final List<Map<String, String>> response = MariaDbConfig.selectQuery(DATABASE_1, "SELECT `id`, `date`, `location` FROM `weather_aus` WHERE `id` = 4", "id", "date", "location");
         final Map<String, String> row1 = response.get(0);
         assertEquals("4", row1.get("id"));
         assertEquals("2022-10-30", row1.get("date"));
@@ -232,8 +214,7 @@ public class QueryServiceIntegrationTest extends BaseUnitTest {
 
     @Test
     public void insert_timestamp_succeeds() throws UserNotFoundException, TableNotFoundException, TableMalformedException,
-            DatabaseConnectionException, DatabaseNotFoundException, ImageNotSupportedException,
-            ContainerNotFoundException, InterruptedException {
+            DatabaseConnectionException, DatabaseNotFoundException, ImageNotSupportedException {
         final TableCsvDto request = TableCsvDto.builder()
                 .data(new HashMap<>() {{
                     put("timestamp", "2023-02-10 12:15:20");
@@ -241,21 +222,18 @@ public class QueryServiceIntegrationTest extends BaseUnitTest {
                 }}).build();
 
         /* mock */
-        DockerConfig.createContainer(BIND_WEATHER, CONTAINER_1, CONTAINER_1_ENV);
-        DockerConfig.startContainer(CONTAINER_1);
-        when(databaseRepository.findByContainerIdAndDatabaseId(CONTAINER_1_ID, DATABASE_1_ID))
+        when(databaseRepository.findByDatabaseId(DATABASE_1_ID))
                 .thenReturn(Optional.of(DATABASE_1));
-        when(tableRepository.find(CONTAINER_1_ID, DATABASE_1_ID, TABLE_7_ID))
+        when(tableRepository.find(DATABASE_1_ID, TABLE_7_ID))
                 .thenReturn(Optional.of(TABLE_7));
 
         /* test */
-        queryService.insert(CONTAINER_1_ID, DATABASE_1_ID, TABLE_7_ID, request, USER_1_PRINCIPAL);
+        queryService.insert(DATABASE_1_ID, TABLE_7_ID, request, USER_1_PRINCIPAL);
     }
 
     @Test
     public void insert_timestampMillis_succeeds() throws UserNotFoundException, TableNotFoundException, TableMalformedException,
-            DatabaseConnectionException, DatabaseNotFoundException, ImageNotSupportedException,
-            ContainerNotFoundException, InterruptedException {
+            DatabaseConnectionException, DatabaseNotFoundException, ImageNotSupportedException {
         final TableCsvDto request = TableCsvDto.builder()
                 .data(new HashMap<>() {{
                     put("timestamp", "2023-02-10 12:15:20.613405");
@@ -263,21 +241,18 @@ public class QueryServiceIntegrationTest extends BaseUnitTest {
                 }}).build();
 
         /* mock */
-        DockerConfig.createContainer(BIND_WEATHER, CONTAINER_1, CONTAINER_1_ENV);
-        DockerConfig.startContainer(CONTAINER_1);
-        when(databaseRepository.findByContainerIdAndDatabaseId(CONTAINER_1_ID, DATABASE_1_ID))
+        when(databaseRepository.findByDatabaseId(DATABASE_1_ID))
                 .thenReturn(Optional.of(DATABASE_1));
-        when(tableRepository.find(CONTAINER_1_ID, DATABASE_1_ID, TABLE_7_ID))
+        when(tableRepository.find(DATABASE_1_ID, TABLE_7_ID))
                 .thenReturn(Optional.of(TABLE_7));
 
         /* test */
-        queryService.insert(CONTAINER_1_ID, DATABASE_1_ID, TABLE_7_ID, request, USER_1_PRINCIPAL);
+        queryService.insert(DATABASE_1_ID, TABLE_7_ID, request, USER_1_PRINCIPAL);
     }
 
     @Test
     public void insert_withConstraints_succeeds() throws UserNotFoundException, TableNotFoundException,
-            TableMalformedException, DatabaseConnectionException, DatabaseNotFoundException, ImageNotSupportedException,
-            ContainerNotFoundException, InterruptedException {
+            TableMalformedException, DatabaseConnectionException, DatabaseNotFoundException, ImageNotSupportedException {
         final TableCsvDto request = TableCsvDto.builder()
                 .data(Map.of("id", 4L,
                         "date", "2008-12-04",
@@ -287,19 +262,17 @@ public class QueryServiceIntegrationTest extends BaseUnitTest {
                 .build();
 
         /* mock */
-        DockerConfig.createContainer(BIND_WEATHER, CONTAINER_1, CONTAINER_1_ENV);
-        DockerConfig.startContainer(CONTAINER_1);
-        when(databaseRepository.findByContainerIdAndDatabaseId(CONTAINER_1_ID, DATABASE_1_ID))
+        when(databaseRepository.findByDatabaseId(DATABASE_1_ID))
                 .thenReturn(Optional.of(DATABASE_1));
-        when(tableRepository.find(CONTAINER_1_ID, DATABASE_1_ID, TABLE_1_ID))
+        when(tableRepository.find(DATABASE_1_ID, TABLE_1_ID))
                 .thenReturn(Optional.of(TABLE_1));
 
         /* test */
-        queryService.insert(CONTAINER_1_ID, DATABASE_1_ID, TABLE_1_ID, request, USER_1_PRINCIPAL);
+        queryService.insert(DATABASE_1_ID, TABLE_1_ID, request, USER_1_PRINCIPAL);
     }
 
     @Test
-    public void insert_violatingForeignKey_fails() throws InterruptedException {
+    public void insert_violatingForeignKey_fails() {
         final TableCsvDto request = TableCsvDto.builder()
                 .data(Map.of("id", 4L,
                         "date", "2008-12-04",
@@ -309,21 +282,19 @@ public class QueryServiceIntegrationTest extends BaseUnitTest {
                 .build();
 
         /* mock */
-        DockerConfig.createContainer(BIND_WEATHER, CONTAINER_1, CONTAINER_1_ENV);
-        DockerConfig.startContainer(CONTAINER_1);
-        when(databaseRepository.findByContainerIdAndDatabaseId(CONTAINER_1_ID, DATABASE_1_ID))
+        when(databaseRepository.findByDatabaseId(DATABASE_1_ID))
                 .thenReturn(Optional.of(DATABASE_1));
-        when(tableRepository.find(CONTAINER_1_ID, DATABASE_1_ID, TABLE_1_ID))
+        when(tableRepository.find(DATABASE_1_ID, TABLE_1_ID))
                 .thenReturn(Optional.of(TABLE_1));
 
         /* test */
         assertThrows(TableMalformedException.class, () -> {
-            queryService.insert(CONTAINER_1_ID, DATABASE_1_ID, TABLE_1_ID, request, USER_1_PRINCIPAL);
+            queryService.insert(DATABASE_1_ID, TABLE_1_ID, request, USER_1_PRINCIPAL);
         });
     }
 
     @Test
-    public void insert_violatingUnique_fails() throws InterruptedException {
+    public void insert_violatingUnique_fails() {
         final TableCsvDto request = TableCsvDto.builder()
                 .data(Map.of("id", 4L,
                         "date", "2008-12-03", // entry with date already exists
@@ -333,21 +304,19 @@ public class QueryServiceIntegrationTest extends BaseUnitTest {
                 .build();
 
         /* mock */
-        DockerConfig.createContainer(BIND_WEATHER, CONTAINER_1, CONTAINER_1_ENV);
-        DockerConfig.startContainer(CONTAINER_1);
-        when(databaseRepository.findByContainerIdAndDatabaseId(CONTAINER_1_ID, DATABASE_1_ID))
+        when(databaseRepository.findByDatabaseId(DATABASE_1_ID))
                 .thenReturn(Optional.of(DATABASE_1));
-        when(tableRepository.find(CONTAINER_1_ID, DATABASE_1_ID, TABLE_1_ID))
+        when(tableRepository.find(DATABASE_1_ID, TABLE_1_ID))
                 .thenReturn(Optional.of(TABLE_1));
 
         /* test */
         assertThrows(TableMalformedException.class, () -> {
-            queryService.insert(CONTAINER_1_ID, DATABASE_1_ID, TABLE_1_ID, request, USER_1_PRINCIPAL);
+            queryService.insert(DATABASE_1_ID, TABLE_1_ID, request, USER_1_PRINCIPAL);
         });
     }
 
     @Test
-    public void insert_violatingCheck_fails() throws InterruptedException {
+    public void insert_violatingCheck_fails() {
         final TableCsvDto request = TableCsvDto.builder()
                 .data(Map.of("id", 4L,
                         "date", "2008-12-04",
@@ -357,73 +326,66 @@ public class QueryServiceIntegrationTest extends BaseUnitTest {
                 .build();
 
         /* mock */
-        DockerConfig.createContainer(BIND_WEATHER, CONTAINER_1, CONTAINER_1_ENV);
-        DockerConfig.startContainer(CONTAINER_1);
-        when(databaseRepository.findByContainerIdAndDatabaseId(CONTAINER_1_ID, DATABASE_1_ID))
+        when(databaseRepository.findByDatabaseId(DATABASE_1_ID))
                 .thenReturn(Optional.of(DATABASE_1));
-        when(tableRepository.find(CONTAINER_1_ID, DATABASE_1_ID, TABLE_1_ID))
+        when(tableRepository.find(DATABASE_1_ID, TABLE_1_ID))
                 .thenReturn(Optional.of(TABLE_1));
 
         /* test */
         assertThrows(TableMalformedException.class, () -> {
-            queryService.insert(CONTAINER_1_ID, DATABASE_1_ID, TABLE_1_ID, request, USER_1_PRINCIPAL);
+            queryService.insert(DATABASE_1_ID, TABLE_1_ID, request, USER_1_PRINCIPAL);
         });
     }
 
     @Test
     public void findAll_timestampMissing_succeeds() throws TableNotFoundException, DatabaseConnectionException,
             TableMalformedException, DatabaseNotFoundException, ImageNotSupportedException, PaginationException,
-            ContainerNotFoundException, QueryMalformedException, UserNotFoundException, InterruptedException {
+            QueryMalformedException, UserNotFoundException {
 
         /* mock */
-        DockerConfig.createContainer(BIND_WEATHER, CONTAINER_1, CONTAINER_1_ENV);
-        DockerConfig.startContainer(CONTAINER_1);
-        when(databaseRepository.findByContainerIdAndDatabaseId(CONTAINER_1_ID, DATABASE_1_ID))
+        when(databaseRepository.findByDatabaseId(DATABASE_1_ID))
                 .thenReturn(Optional.of(DATABASE_1));
-        when(tableRepository.find(CONTAINER_1_ID, DATABASE_1_ID, TABLE_1_ID))
+        when(tableRepository.find(DATABASE_1_ID, TABLE_1_ID))
                 .thenReturn(Optional.of(TABLE_1));
 
         /* test */
-        queryService.tableFindAll(CONTAINER_1_ID, DATABASE_1_ID, TABLE_1_ID, null, null, null, USER_1_PRINCIPAL);
+        queryService.tableFindAll(DATABASE_1_ID, TABLE_1_ID, null, null, null, USER_1_PRINCIPAL);
     }
 
     @Test
     public void findAll_timestampBeforeCreation_succeeds() throws TableNotFoundException, DatabaseConnectionException,
             TableMalformedException, DatabaseNotFoundException, ImageNotSupportedException, PaginationException,
-            ContainerNotFoundException, QueryMalformedException, UserNotFoundException, InterruptedException {
+            QueryMalformedException, UserNotFoundException {
         final Instant timestamp = DATABASE_1_CREATED.minus(1, ChronoUnit.SECONDS);
 
         /* mock */
-        DockerConfig.createContainer(BIND_WEATHER, CONTAINER_1, CONTAINER_1_ENV);
-        DockerConfig.startContainer(CONTAINER_1);
-        when(databaseRepository.findByContainerIdAndDatabaseId(CONTAINER_1_ID, DATABASE_1_ID))
+        when(databaseRepository.findByDatabaseId(DATABASE_1_ID))
                 .thenReturn(Optional.of(DATABASE_1));
-        when(tableRepository.find(CONTAINER_1_ID, DATABASE_1_ID, TABLE_1_ID))
+        when(tableRepository.find(DATABASE_1_ID, TABLE_1_ID))
                 .thenReturn(Optional.of(TABLE_1));
 
         /* test */
-        queryService.tableFindAll(CONTAINER_1_ID, DATABASE_1_ID, TABLE_1_ID, timestamp, null, null, USER_1_PRINCIPAL);
-        queryService.tableFindAll(CONTAINER_1_ID, DATABASE_1_ID, TABLE_1_ID, timestamp, null, null, USER_1_PRINCIPAL);
+        queryService.tableFindAll(DATABASE_1_ID, TABLE_1_ID, timestamp, null, null, USER_1_PRINCIPAL);
+        queryService.tableFindAll(DATABASE_1_ID, TABLE_1_ID, timestamp, null, null, USER_1_PRINCIPAL);
     }
 
     @Test
     public void execute_succeeds() throws DatabaseConnectionException, TableMalformedException,
-            DatabaseNotFoundException, ImageNotSupportedException, ContainerNotFoundException, QueryMalformedException,
+            DatabaseNotFoundException, ImageNotSupportedException, QueryMalformedException,
             UserNotFoundException, QueryStoreException, ColumnParseException, InterruptedException {
         final ExecuteStatementDto request = ExecuteStatementDto.builder()
                 .statement("SELECT n.`firstname`, n.`lastname`, z.`animal_name`, z.`legs` FROM `likes` l JOIN `names` n ON l.`name_id` = n.`id` JOIN `mock_view` z ON z.`id` = l.`zoo_id`")
                 .build();
 
         /* mock */
-        DockerConfig.createContainer(BIND_ZOO, CONTAINER_2, CONTAINER_2_ENV);
-        DockerConfig.startContainer(CONTAINER_2);
-        when(databaseRepository.findByContainerIdAndDatabaseId(CONTAINER_2_ID, DATABASE_2_ID))
+        Thread.sleep(2000); // wait for database creation
+        when(databaseRepository.findByDatabaseId(DATABASE_2_ID))
                 .thenReturn(Optional.of(DATABASE_2));
         when(userRepository.findByUsername(USER_1_USERNAME))
                 .thenReturn(Optional.of(USER_1));
 
         /* test */
-        final QueryResultDto response = queryService.execute(CONTAINER_2_ID, DATABASE_2_ID, request, USER_1_PRINCIPAL,
+        final QueryResultDto response = queryService.execute(DATABASE_2_ID, request, USER_1_PRINCIPAL,
                 0L, 100L, null, null);
         assertEquals(4L, response.getResultNumber());
         assertNotNull(response.getResult());
@@ -448,22 +410,21 @@ public class QueryServiceIntegrationTest extends BaseUnitTest {
 
     @Test
     public void execute_withoutNullField_succeeds() throws DatabaseConnectionException, TableMalformedException,
-            DatabaseNotFoundException, ImageNotSupportedException, ContainerNotFoundException, QueryMalformedException,
+            DatabaseNotFoundException, ImageNotSupportedException, QueryMalformedException,
             UserNotFoundException, QueryStoreException, ColumnParseException, InterruptedException {
         final ExecuteStatementDto request = ExecuteStatementDto.builder()
                 .statement("SELECT `location`, `lng` FROM `weather_location` WHERE `lat` IS NULL")
                 .build();
 
         /* mock */
-        DockerConfig.createContainer(BIND_WEATHER, CONTAINER_1, CONTAINER_1_ENV);
-        DockerConfig.startContainer(CONTAINER_1);
-        when(databaseRepository.findByContainerIdAndDatabaseId(CONTAINER_1_ID, DATABASE_1_ID))
+        Thread.sleep(1000); // wait for database creation
+        when(databaseRepository.findByDatabaseId(DATABASE_1_ID))
                 .thenReturn(Optional.of(DATABASE_1));
         when(userRepository.findByUsername(USER_1_USERNAME))
                 .thenReturn(Optional.of(USER_1));
 
         /* test */
-        final QueryResultDto response = queryService.execute(CONTAINER_1_ID, DATABASE_1_ID, request, USER_1_PRINCIPAL,
+        final QueryResultDto response = queryService.execute(DATABASE_1_ID, request, USER_1_PRINCIPAL,
                 0L, 100L, null, null);
         assertEquals(1L, response.getResultNumber());
         assertNotNull(response.getResult());
@@ -475,22 +436,21 @@ public class QueryServiceIntegrationTest extends BaseUnitTest {
 
     @Test
     public void execute_withoutNullField2_succeeds() throws DatabaseConnectionException, TableMalformedException,
-            DatabaseNotFoundException, ImageNotSupportedException, ContainerNotFoundException, QueryMalformedException,
+            DatabaseNotFoundException, ImageNotSupportedException, QueryMalformedException,
             UserNotFoundException, QueryStoreException, ColumnParseException, InterruptedException {
         final ExecuteStatementDto request = ExecuteStatementDto.builder()
                 .statement("SELECT `location` FROM `weather_location` WHERE `lat` IS NULL")
                 .build();
 
         /* mock */
-        DockerConfig.createContainer(BIND_WEATHER, CONTAINER_1, CONTAINER_1_ENV);
-        DockerConfig.startContainer(CONTAINER_1);
-        when(databaseRepository.findByContainerIdAndDatabaseId(CONTAINER_1_ID, DATABASE_1_ID))
+        Thread.sleep(1000); // wait for database creation
+        when(databaseRepository.findByDatabaseId(DATABASE_1_ID))
                 .thenReturn(Optional.of(DATABASE_1));
         when(userRepository.findByUsername(USER_1_USERNAME))
                 .thenReturn(Optional.of(USER_1));
 
         /* test */
-        final QueryResultDto response = queryService.execute(CONTAINER_1_ID, DATABASE_1_ID, request, USER_1_PRINCIPAL,
+        final QueryResultDto response = queryService.execute(DATABASE_1_ID, request, USER_1_PRINCIPAL,
                 0L, 100L, null, null);
         assertEquals(1L, response.getResultNumber());
         assertNotNull(response.getResult());
@@ -502,22 +462,21 @@ public class QueryServiceIntegrationTest extends BaseUnitTest {
 
     @Test
     public void execute_withNullField_succeeds() throws DatabaseConnectionException, TableMalformedException,
-            DatabaseNotFoundException, ImageNotSupportedException, ContainerNotFoundException, QueryMalformedException,
+            DatabaseNotFoundException, ImageNotSupportedException, QueryMalformedException,
             UserNotFoundException, QueryStoreException, ColumnParseException, InterruptedException {
         final ExecuteStatementDto request = ExecuteStatementDto.builder()
                 .statement("SELECT `lat`, `lng` FROM `weather_location` WHERE `lat` IS NULL")
                 .build();
 
         /* mock */
-        DockerConfig.createContainer(BIND_WEATHER, CONTAINER_1, CONTAINER_1_ENV);
-        DockerConfig.startContainer(CONTAINER_1);
-        when(databaseRepository.findByContainerIdAndDatabaseId(CONTAINER_1_ID, DATABASE_1_ID))
+        Thread.sleep(1000); // wait for database creation
+        when(databaseRepository.findByDatabaseId(DATABASE_1_ID))
                 .thenReturn(Optional.of(DATABASE_1));
         when(userRepository.findByUsername(USER_1_USERNAME))
                 .thenReturn(Optional.of(USER_1));
 
         /* test */
-        final QueryResultDto response = queryService.execute(CONTAINER_1_ID, DATABASE_1_ID, request, USER_1_PRINCIPAL,
+        final QueryResultDto response = queryService.execute(DATABASE_1_ID, request, USER_1_PRINCIPAL,
                 0L, 100L, null, null);
         assertEquals(1L, response.getResultNumber());
         assertNotNull(response.getResult());
@@ -525,22 +484,21 @@ public class QueryServiceIntegrationTest extends BaseUnitTest {
 
     @Test
     public void execute_aliases_succeeds() throws DatabaseConnectionException, TableMalformedException,
-            DatabaseNotFoundException, ImageNotSupportedException, ContainerNotFoundException, QueryMalformedException,
+            DatabaseNotFoundException, ImageNotSupportedException, QueryMalformedException,
             UserNotFoundException, QueryStoreException, ColumnParseException, InterruptedException {
         final ExecuteStatementDto request = ExecuteStatementDto.builder()
                 .statement("SELECT aus.location as a, loc.location from weather_aus aus, weather_location loc")
                 .build();
 
         /* mock */
-        DockerConfig.createContainer(BIND_WEATHER, CONTAINER_1, CONTAINER_1_ENV);
-        DockerConfig.startContainer(CONTAINER_1);
-        when(databaseRepository.findByContainerIdAndDatabaseId(CONTAINER_1_ID, DATABASE_1_ID))
+        Thread.sleep(1000); // wait for database creation
+        when(databaseRepository.findByDatabaseId(DATABASE_1_ID))
                 .thenReturn(Optional.of(DATABASE_1));
         when(userRepository.findByUsername(USER_1_USERNAME))
                 .thenReturn(Optional.of(USER_1));
 
         /* test */
-        final QueryResultDto response = queryService.execute(CONTAINER_1_ID, DATABASE_1_ID, request, USER_1_PRINCIPAL,
+        final QueryResultDto response = queryService.execute(DATABASE_1_ID, request, USER_1_PRINCIPAL,
                 0L, 100L, null, null);
         assertEquals(9L, response.getResultNumber());
         assertNotNull(response.getResult());
@@ -567,22 +525,21 @@ public class QueryServiceIntegrationTest extends BaseUnitTest {
 
     @Test
     public void execute_aliasesWithDatabaseName_succeeds() throws DatabaseConnectionException, TableMalformedException,
-            DatabaseNotFoundException, ImageNotSupportedException, ContainerNotFoundException, QueryMalformedException,
+            DatabaseNotFoundException, ImageNotSupportedException, QueryMalformedException,
             UserNotFoundException, QueryStoreException, ColumnParseException, InterruptedException {
         final ExecuteStatementDto request = ExecuteStatementDto.builder()
                 .statement("SELECT aus.location as a, loc.location from weather.weather_aus aus, weather.weather_location loc")
                 .build();
 
         /* mock */
-        DockerConfig.createContainer(BIND_WEATHER, CONTAINER_1, CONTAINER_1_ENV);
-        DockerConfig.startContainer(CONTAINER_1);
-        when(databaseRepository.findByContainerIdAndDatabaseId(CONTAINER_1_ID, DATABASE_1_ID))
+        Thread.sleep(1000); // wait for database creation
+        when(databaseRepository.findByDatabaseId(DATABASE_1_ID))
                 .thenReturn(Optional.of(DATABASE_1));
         when(userRepository.findByUsername(USER_1_USERNAME))
                 .thenReturn(Optional.of(USER_1));
 
         /* test */
-        final QueryResultDto response = queryService.execute(CONTAINER_1_ID, DATABASE_1_ID, request, USER_1_PRINCIPAL,
+        final QueryResultDto response = queryService.execute(DATABASE_1_ID, request, USER_1_PRINCIPAL,
                 0L, 100L, null, null);
         assertEquals(9L, response.getResultNumber());
         assertNotNull(response.getResult());
@@ -609,9 +566,8 @@ public class QueryServiceIntegrationTest extends BaseUnitTest {
 
     @Test
     public void count_emptySet_succeeds() throws DatabaseConnectionException, TableMalformedException,
-            DatabaseNotFoundException, ImageNotSupportedException, ContainerNotFoundException, QueryMalformedException,
-            UserNotFoundException, QueryStoreException, InterruptedException, QueryNotFoundException,
-            FileStorageException, SQLException {
+            DatabaseNotFoundException, ImageNotSupportedException, QueryMalformedException, UserNotFoundException,
+            QueryStoreException, QueryNotFoundException, FileStorageException, SQLException {
         final Query query = Query.builder()
                 .id(QUERY_1_ID)
                 .query("SELECT `location`, `lat`, `lng` FROM `weather_location` WHERE `location` = \"Vienna\"")
@@ -626,16 +582,14 @@ public class QueryServiceIntegrationTest extends BaseUnitTest {
 
 
         /* mock */
-        DockerConfig.createContainer(BIND_WEATHER, CONTAINER_1, CONTAINER_1_ENV);
-        DockerConfig.startContainer(CONTAINER_1);
-        when(databaseRepository.findByContainerIdAndDatabaseId(CONTAINER_1_ID, DATABASE_1_ID))
+        when(databaseRepository.findByDatabaseId(DATABASE_1_ID))
                 .thenReturn(Optional.of(DATABASE_1));
         when(userRepository.findByUsername(USER_1_USERNAME))
                 .thenReturn(Optional.of(USER_1));
-        MariaDbConfig.insertQueryStore(CONTAINER_1_INTERNALNAME, DATABASE_1_INTERNALNAME, query, USER_1_USERNAME);
+        MariaDbConfig.insertQueryStore(DATABASE_1, query, USER_1_USERNAME);
 
         /* test */
-        final ExportResource response = queryService.findOne(CONTAINER_1_ID, DATABASE_1_ID, QUERY_1_ID, USER_1_PRINCIPAL);
+        final ExportResource response = queryService.findOne(DATABASE_1_ID, QUERY_1_ID, USER_1_PRINCIPAL);
         assertNotNull(response.getFilename());
         assertNotNull(response.getResource());
     }
diff --git a/dbrepo-query-service/rest-service/src/test/java/at/tuwien/service/QueueServiceIntegrationTest.java b/dbrepo-query-service/rest-service/src/test/java/at/tuwien/service/QueueServiceIntegrationTest.java
index 7bc34bce9e..4880281b2d 100644
--- a/dbrepo-query-service/rest-service/src/test/java/at/tuwien/service/QueueServiceIntegrationTest.java
+++ b/dbrepo-query-service/rest-service/src/test/java/at/tuwien/service/QueueServiceIntegrationTest.java
@@ -14,15 +14,24 @@ import at.tuwien.repository.sdb.ViewIdxRepository;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.rabbitmq.client.*;
 import lombok.extern.log4j.Log4j2;
-import org.junit.jupiter.api.*;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.extension.ExtendWith;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.test.context.SpringBootTest;
 import org.springframework.boot.test.mock.mockito.MockBean;
+import org.springframework.test.context.DynamicPropertyRegistry;
+import org.springframework.test.context.DynamicPropertySource;
 import org.springframework.test.context.junit.jupiter.SpringExtension;
+import org.testcontainers.containers.MariaDBContainer;
+import org.testcontainers.containers.RabbitMQContainer;
+import org.testcontainers.junit.jupiter.Container;
+import org.testcontainers.junit.jupiter.Testcontainers;
 
-import java.io.File;
 import java.io.IOException;
+import java.sql.SQLException;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Optional;
@@ -36,6 +45,7 @@ import static org.mockito.Mockito.doThrow;
 import static org.mockito.Mockito.when;
 
 @Log4j2
+@Testcontainers
 @SpringBootTest
 @ExtendWith(SpringExtension.class)
 public class QueueServiceIntegrationTest extends BaseUnitTest {
@@ -79,22 +89,26 @@ public class QueueServiceIntegrationTest extends BaseUnitTest {
     @Autowired
     private MessageQueueService messageQueueService;
 
-    private final static String BIND_WEATHER = new File("../../dbrepo-metadata-db/test/src/test/resources/weather").toPath().toAbsolutePath() + ":/docker-entrypoint-initdb.d";
+    @Container
+    private static MariaDBContainer<?> mariaDBContainer = MariaDbContainerConfig.getContainer();
 
-    @BeforeAll
-    public static void beforeAll() throws InterruptedException {
-        afterAll();
-        DockerConfig.createAllNetworks();
-        DockerConfig.createContainer(BIND_WEATHER, CONTAINER_3, CONTAINER_3_ENV);
-        DockerConfig.startContainer(CONTAINER_3);
-        DockerConfig.createContainer(null, CONTAINER_BROKER, CONTAINER_BROKER_ENV);
-        DockerConfig.startContainer(CONTAINER_BROKER);
+    @Container
+    private static final RabbitMQContainer rabbitMQContainer = new RabbitMQContainer("rabbitmq:3-management-alpine")
+            .withVhost("/");
+
+    @DynamicPropertySource
+    static void rabbitMQProperties(DynamicPropertyRegistry registry) {
+        registry.add("fda.gateway.endpoint", () -> "http://" + rabbitMQContainer.getHost() + ":" + rabbitMQContainer.getHttpPort());
+        registry.add("spring.rabbitmq.host", rabbitMQContainer::getHost);
+        registry.add("spring.rabbitmq.port", rabbitMQContainer::getAmqpPort);
+        registry.add("spring.rabbitmq.username", rabbitMQContainer::getAdminUsername);
+        registry.add("spring.rabbitmq.password", rabbitMQContainer::getAdminPassword);
     }
 
-    @AfterAll
-    public static void afterAll() {
-        DockerConfig.removeAllContainers();
-        DockerConfig.removeAllNetworks();
+    @BeforeAll
+    public static void beforeAll() throws SQLException {
+        MariaDbConfig.dropAllDatabases(CONTAINER_1);
+        MariaDbConfig.createInitDatabase(CONTAINER_1, DATABASE_1);
     }
 
     @BeforeEach
@@ -112,7 +126,7 @@ public class QueueServiceIntegrationTest extends BaseUnitTest {
     public void createConsumer_succeeds() throws AmqpException {
 
         /* test */
-        messageQueueService.createConsumer(TABLE_8_QUEUE_NAME, CONTAINER_3_ID, DATABASE_3_ID, TABLE_8_ID);
+        messageQueueService.createConsumer(TABLE_8_QUEUE_NAME, DATABASE_3_ID, TABLE_8_ID);
     }
 
     @Test
@@ -122,7 +136,7 @@ public class QueueServiceIntegrationTest extends BaseUnitTest {
         channel.close();
 
         /* test */
-        messageQueueService.createConsumer(TABLE_8_QUEUE_NAME, CONTAINER_3_ID, DATABASE_3_ID, TABLE_8_ID);
+        messageQueueService.createConsumer(TABLE_8_QUEUE_NAME, DATABASE_3_ID, TABLE_8_ID);
     }
 
     @Test
@@ -140,14 +154,14 @@ public class QueueServiceIntegrationTest extends BaseUnitTest {
                 }}).build();
 
         /* mock */
-        when(databaseRepository.findByContainerIdAndDatabaseId(CONTAINER_3_ID, DATABASE_3_ID))
+        when(databaseRepository.findByDatabaseId(DATABASE_3_ID))
                 .thenReturn(Optional.of(DATABASE_3));
-        when(tableRepository.find(CONTAINER_3_ID, DATABASE_3_ID, TABLE_8_ID))
+        when(tableRepository.find(DATABASE_3_ID, TABLE_8_ID))
                 .thenReturn(Optional.of(TABLE_8));
         doThrow(IOException.class)
                 .when(rabbitMqConsumer)
                 .handleDelivery(anyString(), any(Envelope.class), any(AMQP.BasicProperties.class), any());
-        messageQueueService.createConsumer(TABLE_8_QUEUE_NAME, CONTAINER_3_ID, DATABASE_3_ID, TABLE_8_ID);
+        messageQueueService.createConsumer(TABLE_8_QUEUE_NAME, DATABASE_3_ID, TABLE_8_ID);
 
         /* test */
         channel.basicPublish(DATABASE_3_EXCHANGE, TABLE_8_ROUTING_KEY, basicProperties, objectMapper.writeValueAsBytes(payload));
@@ -162,14 +176,14 @@ public class QueueServiceIntegrationTest extends BaseUnitTest {
                 .build();
 
         /* mock */
-        when(databaseRepository.findByContainerIdAndDatabaseId(CONTAINER_3_ID, DATABASE_3_ID))
+        when(databaseRepository.findByDatabaseId(DATABASE_3_ID))
                 .thenReturn(Optional.of(DATABASE_3));
-        when(tableRepository.find(CONTAINER_3_ID, DATABASE_3_ID, TABLE_8_ID))
+        when(tableRepository.find(DATABASE_3_ID, TABLE_8_ID))
                 .thenReturn(Optional.of(TABLE_8));
         doThrow(IOException.class)
                 .when(rabbitMqConsumer)
                 .handleDelivery(anyString(), any(Envelope.class), any(AMQP.BasicProperties.class), any());
-        messageQueueService.createConsumer(TABLE_8_QUEUE_NAME, CONTAINER_3_ID, DATABASE_3_ID, TABLE_8_ID);
+        messageQueueService.createConsumer(TABLE_8_QUEUE_NAME, DATABASE_3_ID, TABLE_8_ID);
 
         /* test */
         channel.basicPublish(DATABASE_3_EXCHANGE, TABLE_8_ROUTING_KEY, basicProperties, objectMapper.writeValueAsBytes(TABLE_8_CSV_DTO));
@@ -183,14 +197,14 @@ public class QueueServiceIntegrationTest extends BaseUnitTest {
                 .build();
 
         /* mock */
-        when(databaseRepository.findByContainerIdAndDatabaseId(CONTAINER_3_ID, DATABASE_3_ID))
+        when(databaseRepository.findByDatabaseId(DATABASE_3_ID))
                 .thenReturn(Optional.of(DATABASE_3));
-        when(tableRepository.find(CONTAINER_3_ID, DATABASE_3_ID, TABLE_8_ID))
+        when(tableRepository.find(DATABASE_3_ID, TABLE_8_ID))
                 .thenReturn(Optional.of(TABLE_8));
         doThrow(IOException.class)
                 .when(rabbitMqConsumer)
                 .handleDelivery(anyString(), any(Envelope.class), any(AMQP.BasicProperties.class), any());
-        messageQueueService.createConsumer(TABLE_8_QUEUE_NAME, CONTAINER_3_ID, DATABASE_3_ID, TABLE_8_ID);
+        messageQueueService.createConsumer(TABLE_8_QUEUE_NAME, DATABASE_3_ID, TABLE_8_ID);
 
         /* test */
         channel.basicPublish(DATABASE_3_EXCHANGE, TABLE_8_ROUTING_KEY, basicProperties, objectMapper.writeValueAsBytes(TABLE_8_CSV_DTO));
diff --git a/dbrepo-query-service/rest-service/src/test/java/at/tuwien/service/StoreServiceIntegrationModifyTest.java b/dbrepo-query-service/rest-service/src/test/java/at/tuwien/service/StoreServiceIntegrationModifyTest.java
index 559633c43b..a6be292e50 100644
--- a/dbrepo-query-service/rest-service/src/test/java/at/tuwien/service/StoreServiceIntegrationModifyTest.java
+++ b/dbrepo-query-service/rest-service/src/test/java/at/tuwien/service/StoreServiceIntegrationModifyTest.java
@@ -10,13 +10,15 @@ import at.tuwien.exception.*;
 import at.tuwien.gateway.BrokerServiceGateway;
 import at.tuwien.listener.impl.RabbitMqListenerImpl;
 import at.tuwien.querystore.Query;
-import at.tuwien.repository.mdb.*;
+import at.tuwien.repository.mdb.DatabaseRepository;
+import at.tuwien.repository.mdb.TableRepository;
+import at.tuwien.repository.mdb.UserRepository;
 import at.tuwien.repository.sdb.ViewIdxRepository;
 import com.rabbitmq.client.Channel;
-import at.tuwien.config.DockerConfig;
 import lombok.extern.log4j.Log4j2;
 import org.apache.http.auth.BasicUserPrincipal;
-import org.junit.jupiter.api.*;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.extension.ExtendWith;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
@@ -25,13 +27,15 @@ import org.springframework.boot.test.context.SpringBootTest;
 import org.springframework.boot.test.mock.mockito.MockBean;
 import org.springframework.test.annotation.DirtiesContext;
 import org.springframework.test.context.junit.jupiter.SpringExtension;
+import org.testcontainers.containers.MariaDBContainer;
+import org.testcontainers.junit.jupiter.Container;
+import org.testcontainers.junit.jupiter.Testcontainers;
 
-import java.io.File;
 import java.security.Principal;
 import java.sql.SQLException;
-import java.util.List;
 import java.time.Instant;
 import java.time.temporal.ChronoUnit;
+import java.util.List;
 import java.util.Map;
 import java.util.Optional;
 
@@ -40,6 +44,7 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
 import static org.mockito.Mockito.when;
 
 @Log4j2
+@Testcontainers
 @DirtiesContext(classMode = DirtiesContext.ClassMode.BEFORE_EACH_TEST_METHOD)
 @EnableAutoConfiguration(exclude = RabbitAutoConfiguration.class)
 @ExtendWith(SpringExtension.class)
@@ -76,41 +81,21 @@ public class StoreServiceIntegrationModifyTest extends BaseUnitTest {
     @Autowired
     private StoreService storeService;
 
-    final static String BIND_WEATHER = new File("../../dbrepo-metadata-db/test/src/test/resources/weather").toPath().toAbsolutePath() + ":/docker-entrypoint-initdb.d";
-
     @Autowired
     private QueryService queryService;
 
-    @BeforeAll
-    public static void beforeAll() {
-        afterAll();
-        DockerConfig.createAllNetworks();
-    }
+    @Container
+    @Autowired
+    private MariaDBContainer<?> mariaDBContainer;
 
     @BeforeEach
-    public void beforeEach() throws InterruptedException {
-        afterEach();
-        /* create networks */
-        DockerConfig.createAllNetworks();
-        /* create containers */
-        DockerConfig.createContainer(BIND_WEATHER, CONTAINER_1, CONTAINER_1_ENV);
-        DockerConfig.startContainer(CONTAINER_1);
+    public void beforeEach() throws InterruptedException, SQLException {
         /* metadata database */
         userRepository.save(USER_5);
         DATABASE_1.setTables(List.of(TABLE_1, TABLE_2, TABLE_3, TABLE_7));
         DATABASE_1.setViews(List.of(VIEW_3));
-    }
-
-    @AfterAll
-    public static void afterAll() {
-        DockerConfig.removeAllContainers();
-        DockerConfig.removeAllNetworks();
-    }
-
-    @AfterEach
-    public void afterEach() {
-        DockerConfig.removeAllContainers();
-        DockerConfig.removeAllNetworks();
+        MariaDbConfig.dropAllDatabases(CONTAINER_1);
+        MariaDbConfig.createInitDatabase(CONTAINER_1, DATABASE_1);
     }
 
     @Test
@@ -124,13 +109,13 @@ public class StoreServiceIntegrationModifyTest extends BaseUnitTest {
         /* mock */
         when(userRepository.findByUsername(USER_1_USERNAME))
                 .thenReturn(Optional.of(USER_1));
-        when(databaseRepository.findByContainerIdAndDatabaseId(CONTAINER_1_ID, DATABASE_1_ID))
+        when(databaseRepository.findByDatabaseId(DATABASE_1_ID))
                 .thenReturn(Optional.of(DATABASE_1));
-        MariaDbConfig.insertQueryStore(CONTAINER_1_INTERNALNAME, DATABASE_1_INTERNALNAME, QUERY_1, USER_1_USERNAME);
+        MariaDbConfig.insertQueryStore(DATABASE_1, QUERY_1, USER_1_USERNAME);
 
         /* test */
-        final Query response = storeService.insert(CONTAINER_1_ID, DATABASE_1_ID, request, USER_1_PRINCIPAL);
-        log.debug("found queries in query store: {}", MariaDbConfig.selectQuery(CONTAINER_1_INTERNALNAME, DATABASE_1_INTERNALNAME,
+        final Query response = storeService.insert(DATABASE_1_ID, request, USER_1_PRINCIPAL);
+        log.debug("found queries in query store: {}", MariaDbConfig.selectQuery(DATABASE_1,
                 "SELECT `query_normalized`, `query_hash`, `result_hash` FROM `qs_queries`", "query_normalized", "query_hash", "result_hash"));
         assertEquals(QUERY_1_ID, response.getId()) /* no new query inserted */;
     }
@@ -149,12 +134,12 @@ public class StoreServiceIntegrationModifyTest extends BaseUnitTest {
         /* mock */
         when(userRepository.findByUsername(USER_1_USERNAME))
                 .thenReturn(Optional.of(USER_1));
-        when(databaseRepository.findByContainerIdAndDatabaseId(CONTAINER_1_ID, DATABASE_1_ID))
+        when(databaseRepository.findByDatabaseId(DATABASE_1_ID))
                 .thenReturn(Optional.of(DATABASE_1));
-        queryService.execute(CONTAINER_1_ID, DATABASE_1_ID, mock, USER_1_PRINCIPAL, 0L, 10L, null, null);
+        queryService.execute(DATABASE_1_ID, mock, USER_1_PRINCIPAL, 0L, 10L, null, null);
 
         /* test */
-        final QueryResultDto response = queryService.execute(CONTAINER_1_ID, DATABASE_1_ID, request, USER_1_PRINCIPAL, 0L, 10L, null, null);
+        final QueryResultDto response = queryService.execute(DATABASE_1_ID, request, USER_1_PRINCIPAL, 0L, 10L, null, null);
         assertEquals(2L, response.getId()) /* new query inserted */;
     }
 
@@ -169,12 +154,12 @@ public class StoreServiceIntegrationModifyTest extends BaseUnitTest {
         /* mock */
         when(userRepository.findByUsername(USER_1_USERNAME))
                 .thenReturn(Optional.of(USER_1));
-        when(databaseRepository.findByContainerIdAndDatabaseId(CONTAINER_1_ID, DATABASE_1_ID))
+        when(databaseRepository.findByDatabaseId(DATABASE_1_ID))
                 .thenReturn(Optional.of(DATABASE_1));
-        queryService.execute(CONTAINER_1_ID, DATABASE_1_ID, request, USER_1_PRINCIPAL, 0L, 10L, null, null);
+        queryService.execute(DATABASE_1_ID, request, USER_1_PRINCIPAL, 0L, 10L, null, null);
 
         /* test */
-        final QueryResultDto response = queryService.execute(CONTAINER_1_ID, DATABASE_1_ID, request, USER_1_PRINCIPAL, 0L, 10L, null, null);
+        final QueryResultDto response = queryService.execute(DATABASE_1_ID, request, USER_1_PRINCIPAL, 0L, 10L, null, null);
         assertEquals(1L, response.getId()) /* no new query inserted */;
     }
 
@@ -189,11 +174,11 @@ public class StoreServiceIntegrationModifyTest extends BaseUnitTest {
         /* mock */
         when(userRepository.findByUsername(USER_1_USERNAME))
                 .thenReturn(Optional.of(USER_1));
-        when(databaseRepository.findByContainerIdAndDatabaseId(CONTAINER_1_ID, DATABASE_1_ID))
+        when(databaseRepository.findByDatabaseId(DATABASE_1_ID))
                 .thenReturn(Optional.of(DATABASE_1));
 
         /* test */
-        final QueryResultDto response = queryService.execute(CONTAINER_1_ID, DATABASE_1_ID, request, USER_1_PRINCIPAL, 0L, 10L, null, null);
+        final QueryResultDto response = queryService.execute(DATABASE_1_ID, request, USER_1_PRINCIPAL, 0L, 10L, null, null);
         assertEquals(1L, response.getId()) /* new query inserted */;
     }
 
@@ -208,12 +193,12 @@ public class StoreServiceIntegrationModifyTest extends BaseUnitTest {
         /* mock */
         when(userRepository.findByUsername(USER_1_USERNAME))
                 .thenReturn(Optional.of(USER_1));
-        when(databaseRepository.findByContainerIdAndDatabaseId(CONTAINER_1_ID, DATABASE_1_ID))
+        when(databaseRepository.findByDatabaseId(DATABASE_1_ID))
                 .thenReturn(Optional.of(DATABASE_1));
-        queryService.execute(CONTAINER_1_ID, DATABASE_1_ID, request, USER_1_PRINCIPAL, 0L, 10L, null, null);
+        queryService.execute(DATABASE_1_ID, request, USER_1_PRINCIPAL, 0L, 10L, null, null);
 
         /* test */
-        final QueryResultDto response = queryService.execute(CONTAINER_1_ID, DATABASE_1_ID, request, USER_1_PRINCIPAL, 0L, 10L, null, null);
+        final QueryResultDto response = queryService.execute(DATABASE_1_ID, request, USER_1_PRINCIPAL, 0L, 10L, null, null);
         assertEquals(1L, response.getId()) /* no new query inserted */;
     }
 
@@ -228,13 +213,13 @@ public class StoreServiceIntegrationModifyTest extends BaseUnitTest {
         /* mock */
         when(userRepository.findByUsername(USER_1_USERNAME))
                 .thenReturn(Optional.of(USER_1));
-        when(databaseRepository.findByContainerIdAndDatabaseId(CONTAINER_1_ID, DATABASE_1_ID))
+        when(databaseRepository.findByDatabaseId(DATABASE_1_ID))
                 .thenReturn(Optional.of(DATABASE_1));
-        queryService.execute(CONTAINER_1_ID, DATABASE_1_ID, request, USER_1_PRINCIPAL, 0L, 10L, null, null);
-        MariaDbConfig.execute(CONTAINER_1_INTERNALNAME, DATABASE_1_INTERNALNAME, "INSERT INTO weather_aus (id, `date`, location, mintemp, rainfall) VALUES (4, '2008-12-04', 'Albury', 12.9, 0.2)");
+        queryService.execute(DATABASE_1_ID, request, USER_1_PRINCIPAL, 0L, 10L, null, null);
+        MariaDbConfig.execute(DATABASE_1, "INSERT INTO weather_aus (id, `date`, location, mintemp, rainfall) VALUES (4, '2008-12-04', 'Albury', 12.9, 0.2)");
 
         /* test */
-        storeService.insert(CONTAINER_1_ID, DATABASE_1_ID, request, USER_1_PRINCIPAL);
+        storeService.insert(DATABASE_1_ID, request, USER_1_PRINCIPAL);
     }
 
     @Test
@@ -246,12 +231,12 @@ public class StoreServiceIntegrationModifyTest extends BaseUnitTest {
         /* mock */
         when(userRepository.findByUsername(USER_1_USERNAME))
                 .thenReturn(Optional.of(USER_1));
-        when(databaseRepository.findByContainerIdAndDatabaseId(CONTAINER_1_ID, DATABASE_1_ID))
+        when(databaseRepository.findByDatabaseId(DATABASE_1_ID))
                 .thenReturn(Optional.of(DATABASE_1));
 
         /* test */
         assertThrows(QueryMalformedException.class, () -> {
-            queryService.execute(CONTAINER_1_ID, DATABASE_1_ID, request, USER_1_PRINCIPAL, 0L, 10L, null, null);
+            queryService.execute(DATABASE_1_ID, request, USER_1_PRINCIPAL, 0L, 10L, null, null);
         });
     }
 
@@ -267,11 +252,11 @@ public class StoreServiceIntegrationModifyTest extends BaseUnitTest {
         /* mock */
         when(userRepository.findByUsername(USER_1_USERNAME))
                 .thenReturn(Optional.of(USER_1));
-        when(databaseRepository.findByContainerIdAndDatabaseId(CONTAINER_1_ID, DATABASE_1_ID))
+        when(databaseRepository.findByDatabaseId(DATABASE_1_ID))
                 .thenReturn(Optional.of(DATABASE_1));
 
         /* test */
-        storeService.insert(CONTAINER_1_ID, DATABASE_1_ID, request, USER_1_PRINCIPAL);
+        storeService.insert(DATABASE_1_ID, request, USER_1_PRINCIPAL);
     }
 
     @Test
@@ -285,11 +270,11 @@ public class StoreServiceIntegrationModifyTest extends BaseUnitTest {
         /* mock */
         when(userRepository.findByUsername(USER_5_USERNAME))
                 .thenReturn(Optional.of(USER_5));
-        when(databaseRepository.findByContainerIdAndDatabaseId(CONTAINER_1_ID, DATABASE_1_ID))
+        when(databaseRepository.findByDatabaseId(DATABASE_1_ID))
                 .thenReturn(Optional.of(DATABASE_1));
 
         /* test */
-        storeService.insert(CONTAINER_1_ID, DATABASE_1_ID, request, null);
+        storeService.insert(DATABASE_1_ID, request, null);
     }
 
     @Test
@@ -301,12 +286,12 @@ public class StoreServiceIntegrationModifyTest extends BaseUnitTest {
         /* mock */
         when(userRepository.findByUsername(USER_1_USERNAME))
                 .thenReturn(Optional.empty());
-        when(databaseRepository.findByContainerIdAndDatabaseId(CONTAINER_1_ID, DATABASE_1_ID))
+        when(databaseRepository.findByDatabaseId(DATABASE_1_ID))
                 .thenReturn(Optional.of(DATABASE_1));
 
         /* test */
         assertThrows(UserNotFoundException.class, () -> {
-            storeService.insert(CONTAINER_1_ID, DATABASE_1_ID, request, USER_1_PRINCIPAL);
+            storeService.insert(DATABASE_1_ID, request, USER_1_PRINCIPAL);
         });
     }
 
@@ -315,24 +300,24 @@ public class StoreServiceIntegrationModifyTest extends BaseUnitTest {
             QueryNotFoundException, DatabaseNotFoundException, ImageNotSupportedException, SQLException {
 
         /* mock */
-        when(databaseRepository.findByContainerIdAndDatabaseId(CONTAINER_1_ID, DATABASE_1_ID))
+        when(databaseRepository.findByDatabaseId(DATABASE_1_ID))
                 .thenReturn(Optional.of(DATABASE_1));
-        MariaDbConfig.insertQueryStore(CONTAINER_1_INTERNALNAME, DATABASE_1_INTERNALNAME, QUERY_1, USER_1_USERNAME);
+        MariaDbConfig.insertQueryStore(DATABASE_1, QUERY_1, USER_1_USERNAME);
 
         /* test */
-        storeService.findOne(CONTAINER_1_ID, DATABASE_1_ID, QUERY_1_ID, USER_1_PRINCIPAL);
+        storeService.findOne(DATABASE_1_ID, QUERY_1_ID, USER_1_PRINCIPAL);
     }
 
     @Test
     public void findOne_notFound_succeeds() {
 
         /* mock */
-        when(databaseRepository.findByContainerIdAndDatabaseId(CONTAINER_1_ID, DATABASE_1_ID))
+        when(databaseRepository.findByDatabaseId(DATABASE_1_ID))
                 .thenReturn(Optional.of(DATABASE_1));
 
         /* test */
         assertThrows(QueryNotFoundException.class, () -> {
-            storeService.findOne(CONTAINER_1_ID, DATABASE_1_ID, 9999L, USER_1_PRINCIPAL);
+            storeService.findOne(DATABASE_1_ID, 9999L, USER_1_PRINCIPAL);
         });
     }
 
@@ -341,12 +326,12 @@ public class StoreServiceIntegrationModifyTest extends BaseUnitTest {
         final Principal principal = new BasicUserPrincipal(USER_1_USERNAME);
 
         /* mock */
-        when(databaseRepository.findByContainerIdAndDatabaseId(CONTAINER_1_ID, DATABASE_1_ID))
+        when(databaseRepository.findByDatabaseId(DATABASE_1_ID))
                 .thenReturn(Optional.of(DATABASE_1));
 
         /* test */
         assertThrows(QueryNotFoundException.class, () -> {
-            storeService.findOne(CONTAINER_1_ID, DATABASE_1_ID, 9999L, principal);
+            storeService.findOne(DATABASE_1_ID, 9999L, principal);
         });
     }
 
@@ -376,14 +361,14 @@ public class StoreServiceIntegrationModifyTest extends BaseUnitTest {
                 .build();
 
         /* mock */
-        MariaDbConfig.insertQueryStore(CONTAINER_1_INTERNALNAME, DATABASE_1_INTERNALNAME, queryOk, USER_1_USERNAME);
-        MariaDbConfig.insertQueryStore(CONTAINER_1_INTERNALNAME, DATABASE_1_INTERNALNAME, queryDelete, USER_1_USERNAME);
+        MariaDbConfig.insertQueryStore(DATABASE_1, queryOk, USER_1_USERNAME);
+        MariaDbConfig.insertQueryStore(DATABASE_1, queryDelete, USER_1_USERNAME);
         when(databaseRepository.findAll())
                 .thenReturn(List.of(DATABASE_1));
 
         /* test */
         storeService.deleteStaleQueries();
-        final List<Map<String, Object>> response = MariaDbConfig.listQueryStore(CONTAINER_1_INTERNALNAME, DATABASE_1_INTERNALNAME);
+        final List<Map<String, Object>> response = MariaDbConfig.listQueryStore(DATABASE_1);
         assertEquals(1, response.size());
     }
 
diff --git a/dbrepo-query-service/rest-service/src/test/java/at/tuwien/service/StoreServiceIntegrationReadTest.java b/dbrepo-query-service/rest-service/src/test/java/at/tuwien/service/StoreServiceIntegrationReadTest.java
index f41d511770..e9f67eb185 100644
--- a/dbrepo-query-service/rest-service/src/test/java/at/tuwien/service/StoreServiceIntegrationReadTest.java
+++ b/dbrepo-query-service/rest-service/src/test/java/at/tuwien/service/StoreServiceIntegrationReadTest.java
@@ -3,6 +3,7 @@ package at.tuwien.service;
 import at.tuwien.BaseUnitTest;
 import at.tuwien.config.IndexConfig;
 import at.tuwien.config.MariaDbConfig;
+import at.tuwien.config.MariaDbContainerConfig;
 import at.tuwien.config.ReadyConfig;
 import at.tuwien.exception.*;
 import at.tuwien.listener.impl.RabbitMqListenerImpl;
@@ -12,10 +13,11 @@ import at.tuwien.repository.mdb.TableRepository;
 import at.tuwien.repository.mdb.UserRepository;
 import at.tuwien.repository.sdb.ViewIdxRepository;
 import com.rabbitmq.client.Channel;
-import at.tuwien.config.DockerConfig;
 import lombok.extern.log4j.Log4j2;
 import org.apache.http.auth.BasicUserPrincipal;
-import org.junit.jupiter.api.*;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.extension.ExtendWith;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
@@ -23,8 +25,10 @@ import org.springframework.boot.autoconfigure.amqp.RabbitAutoConfiguration;
 import org.springframework.boot.test.context.SpringBootTest;
 import org.springframework.boot.test.mock.mockito.MockBean;
 import org.springframework.test.context.junit.jupiter.SpringExtension;
+import org.testcontainers.containers.MariaDBContainer;
+import org.testcontainers.junit.jupiter.Container;
+import org.testcontainers.junit.jupiter.Testcontainers;
 
-import java.io.File;
 import java.security.Principal;
 import java.sql.SQLException;
 import java.util.List;
@@ -35,6 +39,7 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
 import static org.mockito.Mockito.when;
 
 @Log4j2
+@Testcontainers
 @ExtendWith(SpringExtension.class)
 @EnableAutoConfiguration(exclude= RabbitAutoConfiguration.class)
 @SpringBootTest
@@ -67,18 +72,15 @@ public class StoreServiceIntegrationReadTest extends BaseUnitTest {
     @Autowired
     private StoreService storeService;
 
-    final static String BIND_WEATHER = new File("../../dbrepo-metadata-db/test/src/test/resources/weather").toPath().toAbsolutePath() + ":/docker-entrypoint-initdb.d";
+    @Container
+    private static MariaDBContainer<?> mariaDBContainer = MariaDbContainerConfig.getContainer();
 
     @BeforeAll
-    public static void beforeAll() throws InterruptedException, SQLException {
-        afterAll();
-        /* create networks */
-        DockerConfig.createAllNetworks();
-        /* create user container */
-        DockerConfig.createContainer(BIND_WEATHER, CONTAINER_1, CONTAINER_1_ENV);
-        DockerConfig.startContainer(CONTAINER_1);
+    public static void beforeAll() throws SQLException {
         /* insert query */
-        MariaDbConfig.insertQueryStore(CONTAINER_1_INTERNALNAME, DATABASE_1_INTERNALNAME, QUERY_1, USER_1_USERNAME);
+        MariaDbConfig.dropAllDatabases(CONTAINER_1);
+        MariaDbConfig.createInitDatabase(CONTAINER_1, DATABASE_1);
+        MariaDbConfig.insertQueryStore(DATABASE_1, QUERY_1, USER_1_USERNAME);
     }
 
     @BeforeEach
@@ -89,22 +91,16 @@ public class StoreServiceIntegrationReadTest extends BaseUnitTest {
         DATABASE_1.setViews(List.of(VIEW_3));
     }
 
-    @AfterAll
-    public static void afterAll() {
-        DockerConfig.removeAllContainers();
-        DockerConfig.removeAllNetworks();
-    }
-
     @Test
     public void findAll_succeeds() throws UserNotFoundException, QueryStoreException, DatabaseConnectionException,
             DatabaseNotFoundException, ImageNotSupportedException, TableMalformedException, ContainerNotFoundException {
 
         /* mock */
-        when(databaseRepository.findByContainerIdAndDatabaseId(CONTAINER_1_ID, DATABASE_1_ID))
+        when(databaseRepository.findByDatabaseId(DATABASE_1_ID))
                 .thenReturn(Optional.of(DATABASE_1));
 
         /* test */
-        final List<Query> queries = storeService.findAll(CONTAINER_1_ID, DATABASE_1_ID, null, USER_1_PRINCIPAL);
+        final List<Query> queries = storeService.findAll(DATABASE_1_ID, null, USER_1_PRINCIPAL);
         assertEquals(1, queries.size());
     }
 
@@ -113,11 +109,11 @@ public class StoreServiceIntegrationReadTest extends BaseUnitTest {
             DatabaseNotFoundException, ImageNotSupportedException, TableMalformedException, ContainerNotFoundException {
 
         /* mock */
-        when(databaseRepository.findByContainerIdAndDatabaseId(CONTAINER_1_ID, DATABASE_1_ID))
+        when(databaseRepository.findByDatabaseId(DATABASE_1_ID))
                 .thenReturn(Optional.of(DATABASE_1));
 
         /* test */
-        final List<Query> queries = storeService.findAll(CONTAINER_1_ID, DATABASE_1_ID, true, USER_1_PRINCIPAL);
+        final List<Query> queries = storeService.findAll(DATABASE_1_ID, true, USER_1_PRINCIPAL);
         assertEquals(0, queries.size());
     }
 
@@ -126,23 +122,23 @@ public class StoreServiceIntegrationReadTest extends BaseUnitTest {
             DatabaseConnectionException, QueryNotFoundException, DatabaseNotFoundException, ImageNotSupportedException {
 
         /* mock */
-        when(databaseRepository.findByContainerIdAndDatabaseId(CONTAINER_1_ID, DATABASE_1_ID))
+        when(databaseRepository.findByDatabaseId(DATABASE_1_ID))
                 .thenReturn(Optional.of(DATABASE_1));
 
         /* test */
-        storeService.findOne(CONTAINER_1_ID, DATABASE_1_ID, QUERY_1_ID, USER_1_PRINCIPAL);
+        storeService.findOne(DATABASE_1_ID, QUERY_1_ID, USER_1_PRINCIPAL);
     }
 
     @Test
     public void findOne_notFound_succeeds() {
 
         /* mock */
-        when(databaseRepository.findByContainerIdAndDatabaseId(CONTAINER_1_ID, DATABASE_1_ID))
+        when(databaseRepository.findByDatabaseId(DATABASE_1_ID))
                 .thenReturn(Optional.of(DATABASE_1));
 
         /* test */
         assertThrows(QueryNotFoundException.class, () -> {
-            storeService.findOne(CONTAINER_1_ID, DATABASE_1_ID, 9999L, USER_1_PRINCIPAL);
+            storeService.findOne(DATABASE_1_ID, 9999L, USER_1_PRINCIPAL);
         });
     }
 
@@ -151,12 +147,12 @@ public class StoreServiceIntegrationReadTest extends BaseUnitTest {
         final Principal principal = new BasicUserPrincipal(USER_1_USERNAME);
 
         /* mock */
-        when(databaseRepository.findByContainerIdAndDatabaseId(CONTAINER_1_ID, DATABASE_1_ID))
+        when(databaseRepository.findByDatabaseId(DATABASE_1_ID))
                 .thenReturn(Optional.of(DATABASE_1));
 
         /* test */
         assertThrows(QueryNotFoundException.class, () -> {
-            storeService.findOne(CONTAINER_1_ID, DATABASE_1_ID, QUERY_2_ID, principal);
+            storeService.findOne(DATABASE_1_ID, QUERY_2_ID, principal);
         });
     }
 
diff --git a/dbrepo-query-service/rest-service/src/test/java/at/tuwien/service/TableServiceIntegrationReadTest.java b/dbrepo-query-service/rest-service/src/test/java/at/tuwien/service/TableServiceIntegrationReadTest.java
index f7b8b21bff..cfdccd21a9 100644
--- a/dbrepo-query-service/rest-service/src/test/java/at/tuwien/service/TableServiceIntegrationReadTest.java
+++ b/dbrepo-query-service/rest-service/src/test/java/at/tuwien/service/TableServiceIntegrationReadTest.java
@@ -2,8 +2,9 @@ package at.tuwien.service;
 
 import at.tuwien.BaseUnitTest;
 import at.tuwien.api.database.table.TableHistoryDto;
-import at.tuwien.config.H2Utils;
 import at.tuwien.config.IndexConfig;
+import at.tuwien.config.MariaDbConfig;
+import at.tuwien.config.MariaDbContainerConfig;
 import at.tuwien.config.ReadyConfig;
 import at.tuwien.exception.*;
 import at.tuwien.gateway.BrokerServiceGateway;
@@ -11,9 +12,10 @@ import at.tuwien.listener.impl.RabbitMqListenerImpl;
 import at.tuwien.repository.mdb.*;
 import at.tuwien.repository.sdb.ViewIdxRepository;
 import com.rabbitmq.client.Channel;
-import at.tuwien.config.DockerConfig;
 import lombok.extern.log4j.Log4j2;
-import org.junit.jupiter.api.*;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.extension.ExtendWith;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
@@ -24,8 +26,11 @@ import org.springframework.security.test.context.support.WithAnonymousUser;
 import org.springframework.security.test.context.support.WithMockUser;
 import org.springframework.test.annotation.DirtiesContext;
 import org.springframework.test.context.junit.jupiter.SpringExtension;
+import org.testcontainers.containers.MariaDBContainer;
+import org.testcontainers.junit.jupiter.Container;
+import org.testcontainers.junit.jupiter.Testcontainers;
 
-import java.io.File;
+import java.sql.SQLException;
 import java.util.List;
 import java.util.Optional;
 
@@ -34,6 +39,7 @@ import static org.mockito.Mockito.when;
 
 
 @Log4j2
+@Testcontainers
 @DirtiesContext(classMode = DirtiesContext.ClassMode.BEFORE_EACH_TEST_METHOD)
 @EnableAutoConfiguration(exclude= RabbitAutoConfiguration.class)
 @SpringBootTest
@@ -79,25 +85,13 @@ public class TableServiceIntegrationReadTest extends BaseUnitTest {
     @Autowired
     private TableService tableService;
 
-    @Autowired
-    private H2Utils h2Utils;
-
-    final static String BIND_WEATHER = new File("../../dbrepo-metadata-db/test/src/test/resources/weather").toPath().toAbsolutePath() + ":/docker-entrypoint-initdb.d";
+    @Container
+    private static MariaDBContainer<?> mariaDBContainer = MariaDbContainerConfig.getContainer();
 
     @BeforeAll
-    public static void beforeAll() throws InterruptedException {
-        afterAll();
-        /* create networks */
-        DockerConfig.createAllNetworks();
-        /* user container */
-        DockerConfig.createContainer(BIND_WEATHER, CONTAINER_1, CONTAINER_1_ENV);
-        DockerConfig.startContainer(CONTAINER_1);
-    }
-
-    @AfterAll
-    public static void afterAll() {
-        DockerConfig.removeAllContainers();
-        DockerConfig.removeAllNetworks();
+    public static void beforeAll() throws SQLException {
+        MariaDbConfig.dropAllDatabases(CONTAINER_1);
+        MariaDbConfig.createInitDatabase(CONTAINER_1, DATABASE_1);
     }
 
     @BeforeEach
@@ -120,11 +114,11 @@ public class TableServiceIntegrationReadTest extends BaseUnitTest {
             QueryStoreException, DatabaseConnectionException, QueryMalformedException, DatabaseNotFoundException {
 
         /* mock */
-        when(tableRepository.find(CONTAINER_1_ID, DATABASE_1_ID, TABLE_1_ID))
+        when(tableRepository.find(DATABASE_1_ID, TABLE_1_ID))
                 .thenReturn(Optional.of(TABLE_1));
 
         /* test */
-        final List<TableHistoryDto> response = tableService.findHistory(CONTAINER_1_ID, DATABASE_1_ID, TABLE_1_ID, null);
+        final List<TableHistoryDto> response = tableService.findHistory(DATABASE_1_ID, TABLE_1_ID, null);
         assertEquals(1, response.size());
         final TableHistoryDto history = response.get(0);
         assertEquals("INSERT", history.getEvent());
@@ -136,11 +130,11 @@ public class TableServiceIntegrationReadTest extends BaseUnitTest {
             QueryStoreException, DatabaseConnectionException, QueryMalformedException, DatabaseNotFoundException {
 
         /* mock */
-        when(tableRepository.find(CONTAINER_1_ID, DATABASE_1_ID, TABLE_1_ID))
+        when(tableRepository.find(DATABASE_1_ID, TABLE_1_ID))
                 .thenReturn(Optional.of(TABLE_1));
 
         /* test */
-        final List<TableHistoryDto> response = tableService.findHistory(CONTAINER_1_ID, DATABASE_1_ID, TABLE_1_ID, null);
+        final List<TableHistoryDto> response = tableService.findHistory(DATABASE_1_ID, TABLE_1_ID, null);
         assertEquals(1, response.size());
         final TableHistoryDto history = response.get(0);
         assertEquals("INSERT", history.getEvent());
@@ -152,11 +146,11 @@ public class TableServiceIntegrationReadTest extends BaseUnitTest {
             QueryStoreException, DatabaseConnectionException, QueryMalformedException, DatabaseNotFoundException {
 
         /* mock */
-        when(tableRepository.find(CONTAINER_1_ID, DATABASE_1_ID, TABLE_1_ID))
+        when(tableRepository.find(DATABASE_1_ID, TABLE_1_ID))
                 .thenReturn(Optional.of(TABLE_1));
 
         /* test */
-        final List<TableHistoryDto> response = tableService.findHistory(CONTAINER_1_ID, DATABASE_1_ID, TABLE_1_ID, USER_1_PRINCIPAL);
+        final List<TableHistoryDto> response = tableService.findHistory(DATABASE_1_ID, TABLE_1_ID, USER_1_PRINCIPAL);
         assertEquals(1, response.size());
         final TableHistoryDto history = response.get(0);
         assertEquals("INSERT", history.getEvent());
@@ -168,11 +162,11 @@ public class TableServiceIntegrationReadTest extends BaseUnitTest {
             QueryStoreException, DatabaseConnectionException, QueryMalformedException, DatabaseNotFoundException {
 
         /* mock */
-        when(tableRepository.find(CONTAINER_1_ID, DATABASE_1_ID, TABLE_1_ID))
+        when(tableRepository.find(DATABASE_1_ID, TABLE_1_ID))
                 .thenReturn(Optional.of(TABLE_1));
 
         /* test */
-        final List<TableHistoryDto> response = tableService.findHistory(CONTAINER_1_ID, DATABASE_1_ID, TABLE_1_ID, USER_2_PRINCIPAL);
+        final List<TableHistoryDto> response = tableService.findHistory(DATABASE_1_ID, TABLE_1_ID, USER_2_PRINCIPAL);
         assertEquals(1, response.size());
         final TableHistoryDto history = response.get(0);
         assertEquals("INSERT", history.getEvent());
@@ -184,11 +178,11 @@ public class TableServiceIntegrationReadTest extends BaseUnitTest {
             QueryStoreException, DatabaseConnectionException, QueryMalformedException, DatabaseNotFoundException {
 
         /* mock */
-        when(tableRepository.find(CONTAINER_1_ID, DATABASE_1_ID, TABLE_1_ID))
+        when(tableRepository.find(DATABASE_1_ID, TABLE_1_ID))
                 .thenReturn(Optional.of(TABLE_1));
 
         /* test */
-        final List<TableHistoryDto> response = tableService.findHistory(CONTAINER_1_ID, DATABASE_1_ID, TABLE_1_ID, USER_3_PRINCIPAL);
+        final List<TableHistoryDto> response = tableService.findHistory(DATABASE_1_ID, TABLE_1_ID, USER_3_PRINCIPAL);
         assertEquals(1, response.size());
         final TableHistoryDto history = response.get(0);
         assertEquals("INSERT", history.getEvent());
diff --git a/dbrepo-query-service/rest-service/src/test/java/at/tuwien/service/TableServiceUnitTest.java b/dbrepo-query-service/rest-service/src/test/java/at/tuwien/service/TableServiceUnitTest.java
index 5c91cb6b6b..1c05a0c428 100644
--- a/dbrepo-query-service/rest-service/src/test/java/at/tuwien/service/TableServiceUnitTest.java
+++ b/dbrepo-query-service/rest-service/src/test/java/at/tuwien/service/TableServiceUnitTest.java
@@ -4,14 +4,15 @@ import at.tuwien.BaseUnitTest;
 import at.tuwien.config.IndexConfig;
 import at.tuwien.config.ReadyConfig;
 import at.tuwien.entities.database.table.columns.TableColumn;
-import at.tuwien.exception.*;
+import at.tuwien.exception.DatabaseNotFoundException;
+import at.tuwien.exception.TableNotFoundException;
 import at.tuwien.gateway.BrokerServiceGateway;
 import at.tuwien.listener.impl.RabbitMqListenerImpl;
-import at.tuwien.repository.mdb.*;
+import at.tuwien.repository.mdb.TableRepository;
 import at.tuwien.repository.sdb.ViewIdxRepository;
 import com.rabbitmq.client.Channel;
 import lombok.extern.log4j.Log4j2;
-import org.junit.jupiter.api.*;
+import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.extension.ExtendWith;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
@@ -24,7 +25,7 @@ import org.springframework.test.context.junit.jupiter.SpringExtension;
 import java.util.List;
 import java.util.Optional;
 
-import static org.junit.jupiter.api.Assertions.*;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.mockito.Mockito.when;
 
 
@@ -63,11 +64,11 @@ public class TableServiceUnitTest extends BaseUnitTest {
     public void findAll_succeeds() throws TableNotFoundException, DatabaseNotFoundException {
 
         /* mock */
-        when(tableRepository.find(CONTAINER_3_ID, DATABASE_3_ID, TABLE_8_ID))
+        when(tableRepository.find(DATABASE_3_ID, TABLE_8_ID))
                 .thenReturn(Optional.of(TABLE_8));
 
         /* test */
-        final List<TableColumn> response = tableService.find(CONTAINER_3_ID, DATABASE_3_ID, TABLE_8_ID)
+        final List<TableColumn> response = tableService.find(DATABASE_3_ID, TABLE_8_ID)
                 .getColumns();
         assertEquals(2, response.size());
         assertEquals("id", response.get(0).getInternalName());
diff --git a/dbrepo-query-service/rest-service/src/test/java/at/tuwien/service/ViewServiceIntegrationTest.java b/dbrepo-query-service/rest-service/src/test/java/at/tuwien/service/ViewServiceIntegrationTest.java
index 10d216bf3b..e4bfed8e29 100644
--- a/dbrepo-query-service/rest-service/src/test/java/at/tuwien/service/ViewServiceIntegrationTest.java
+++ b/dbrepo-query-service/rest-service/src/test/java/at/tuwien/service/ViewServiceIntegrationTest.java
@@ -5,17 +5,18 @@ import at.tuwien.api.database.ViewCreateDto;
 import at.tuwien.api.database.ViewDto;
 import at.tuwien.config.IndexConfig;
 import at.tuwien.config.MariaDbConfig;
+import at.tuwien.config.MariaDbContainerConfig;
 import at.tuwien.config.ReadyConfig;
 import at.tuwien.entities.database.View;
 import at.tuwien.exception.*;
 import at.tuwien.gateway.BrokerServiceGateway;
 import at.tuwien.listener.impl.RabbitMqListenerImpl;
+import at.tuwien.repository.mdb.DatabaseRepository;
+import at.tuwien.repository.mdb.UserRepository;
+import at.tuwien.repository.mdb.ViewRepository;
 import at.tuwien.repository.sdb.ViewIdxRepository;
-import at.tuwien.repository.mdb.*;
 import com.rabbitmq.client.Channel;
-import at.tuwien.config.DockerConfig;
 import lombok.extern.log4j.Log4j2;
-import org.junit.jupiter.api.AfterAll;
 import org.junit.jupiter.api.BeforeAll;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
@@ -27,8 +28,10 @@ import org.springframework.boot.test.context.SpringBootTest;
 import org.springframework.boot.test.mock.mockito.MockBean;
 import org.springframework.test.annotation.DirtiesContext;
 import org.springframework.test.context.junit.jupiter.SpringExtension;
+import org.testcontainers.containers.MariaDBContainer;
+import org.testcontainers.junit.jupiter.Container;
+import org.testcontainers.junit.jupiter.Testcontainers;
 
-import java.io.File;
 import java.sql.SQLException;
 import java.util.List;
 import java.util.Map;
@@ -41,6 +44,7 @@ import static org.mockito.Mockito.when;
 
 
 @Log4j2
+@Testcontainers
 @DirtiesContext(classMode = DirtiesContext.ClassMode.BEFORE_EACH_TEST_METHOD)
 @EnableAutoConfiguration(exclude= RabbitAutoConfiguration.class)
 @SpringBootTest
@@ -79,22 +83,13 @@ public class ViewServiceIntegrationTest extends BaseUnitTest {
     @Autowired
     private ViewService viewService;
 
-    final static String BIND_WEATHER = new File("../../dbrepo-metadata-db/test/src/test/resources/weather").toPath().toAbsolutePath() + ":/docker-entrypoint-initdb.d";
+    @Container
+    private static MariaDBContainer<?> mariaDBContainer = MariaDbContainerConfig.getContainer();
 
     @BeforeAll
-    public static void beforeAll() throws InterruptedException {
-        afterAll();
-        /* create network */
-        DockerConfig.createAllNetworks();
-        /* create container */
-        DockerConfig.createContainer(BIND_WEATHER, CONTAINER_1, CONTAINER_1_ENV);
-        DockerConfig.startContainer(CONTAINER_1);
-    }
-
-    @AfterAll
-    public static void afterAll() {
-        DockerConfig.removeAllContainers();
-        DockerConfig.removeAllNetworks();
+    public static void beforeAll() throws SQLException {
+        MariaDbConfig.dropAllDatabases(CONTAINER_1);
+        MariaDbConfig.createInitDatabase(CONTAINER_1, DATABASE_1);
     }
 
     @BeforeEach
@@ -113,7 +108,7 @@ public class ViewServiceIntegrationTest extends BaseUnitTest {
                 .build();
 
         /* mock */
-        when(databaseRepository.findByContainerIdAndDatabaseId(CONTAINER_1_ID, DATABASE_1_ID))
+        when(databaseRepository.findByDatabaseId(DATABASE_1_ID))
                 .thenReturn(Optional.of(DATABASE_1));
         when(userRepository.findByUsername(USER_1_USERNAME))
                 .thenReturn(Optional.of(USER_1));
@@ -123,12 +118,12 @@ public class ViewServiceIntegrationTest extends BaseUnitTest {
                 .thenReturn(VIEW_3_DTO);
 
         /* test */
-        final View response = viewService.create(CONTAINER_1_ID, DATABASE_1_ID, request, USER_1_PRINCIPAL);
+        final View response = viewService.create(DATABASE_1_ID, request, USER_1_PRINCIPAL);
         assertEquals(VIEW_3_ID, response.getId());
         assertEquals(VIEW_3_NAME, response.getName());
         assertEquals(VIEW_3_INTERNAL_NAME, response.getInternalName());
         assertEquals(VIEW_3_QUERY, response.getQuery());
-        final List<Map<String, String>> resultSet = MariaDbConfig.selectQuery(CONTAINER_1_INTERNALNAME, DATABASE_1_INTERNALNAME,
+        final List<Map<String, String>> resultSet = MariaDbConfig.selectQuery(DATABASE_1,
                 "SELECT j.* FROM `debug` j", "mintemp", "rainfall", "date", "location");
         assertEquals("13.4", resultSet.get(0).get("mintemp"));
         assertEquals("0.6", resultSet.get(0).get("rainfall"));
@@ -155,7 +150,7 @@ public class ViewServiceIntegrationTest extends BaseUnitTest {
                 .build();
 
         /* mock */
-        when(databaseRepository.findByContainerIdAndDatabaseId(CONTAINER_1_ID, DATABASE_1_ID))
+        when(databaseRepository.findByDatabaseId(DATABASE_1_ID))
                 .thenReturn(Optional.of(DATABASE_1));
         when(userRepository.findByUsername(USER_1_USERNAME))
                 .thenReturn(Optional.of(USER_1));
@@ -165,12 +160,12 @@ public class ViewServiceIntegrationTest extends BaseUnitTest {
                 .thenReturn(VIEW_1_DTO);
 
         /* test */
-        final View response = viewService.create(CONTAINER_1_ID, DATABASE_1_ID, request, USER_1_PRINCIPAL);
+        final View response = viewService.create(DATABASE_1_ID, request, USER_1_PRINCIPAL);
         assertEquals(VIEW_1_ID, response.getId());
         assertEquals(VIEW_1_NAME, response.getName());
         assertEquals(VIEW_1_INTERNAL_NAME, response.getInternalName());
         assertEquals(VIEW_1_QUERY, response.getQuery());
-        final List<Map<String, String>> resultSet = MariaDbConfig.selectQuery(CONTAINER_1_INTERNALNAME, DATABASE_1_INTERNALNAME,
+        final List<Map<String, String>> resultSet = MariaDbConfig.selectQuery(DATABASE_1,
                 "SELECT l.`location`, l.`lat`, l.`lng` FROM `weather_location` l ORDER BY l.`location` ASC", "location", "lat", "lng");
         assertEquals(3, resultSet.size());
         final Map<String, String> row0 = resultSet.get(0);
diff --git a/dbrepo-query-service/rest-service/src/test/resources/application.properties b/dbrepo-query-service/rest-service/src/test/resources/application.properties
index c030a10c37..7f4fe59834 100644
--- a/dbrepo-query-service/rest-service/src/test/resources/application.properties
+++ b/dbrepo-query-service/rest-service/src/test/resources/application.properties
@@ -9,22 +9,19 @@ spring.cloud.config.discovery.enabled=false
 spring.cloud.config.enabled=false
 
 # internal datasource
-# spring 6 fix https://github.com/h2database/h2database/issues/3363
-spring.datasource.url=jdbc:h2:mem:testdb;NON_KEYWORDS=VALUE,KEY;DB_CLOSE_ON_EXIT=FALSE;INIT=CREATE SCHEMA IF NOT EXISTS FDA
-spring.datasource.driverClassName=org.h2.Driver
-spring.datasource.username=sa
-spring.datasource.password=password
-spring.jpa.database-platform=org.hibernate.dialect.H2Dialect
-spring.jpa.hibernate.ddl-auto=create-drop
-spring.jpa.show-sql=false
+spring.datasource.driver-class-name=org.hsqldb.jdbc.JDBCDriver
+spring.datasource.url=jdbc:hsqldb:mem:testdb;db_close_delay=-1;sql.syntax_mys=true
+spring.jpa.database-platform=org.hibernate.dialect.HSQLDialect
+spring.datasource.username=root
+spring.datasource.password=dbrepo
+spring.sql.init.mode=always
+spring.sql.init.schema-locations=classpath*:init/schema.sql
+spring.jpa.hibernate.ddl-auto=create
 
 # additional logging
 logging.level.root=error
 logging.level.at.tuwien.=trace
 
-# elastic
-spring.elasticsearch.uris=dbrepo-search-db:9200
-
 # broker service
 spring.rabbitmq.host=dbrepo-broker-service
 spring.rabbitmq.virtual-host=/
@@ -33,5 +30,4 @@ spring.rabbitmq.password=guest
 
 # search service
 fda.consumers=2
-fda.gateway.endpoint: http://localhost:15672
-fda.elastic.endpoint=dbrepo-search-db:9200
\ No newline at end of file
+fda.gateway.endpoint: http://localhost:15672
\ No newline at end of file
diff --git a/dbrepo-query-service/rest-service/src/test/resources/init/musicology.sql b/dbrepo-query-service/rest-service/src/test/resources/init/musicology.sql
new file mode 100644
index 0000000000..4d2c8deb43
--- /dev/null
+++ b/dbrepo-query-service/rest-service/src/test/resources/init/musicology.sql
@@ -0,0 +1,18 @@
+CREATE DATABASE musicology;
+USE musicology;
+
+CREATE SEQUENCE seq_mfcc;
+
+CREATE TABLE mfcc
+(
+    id    BIGINT PRIMARY KEY NOT NULL DEFAULT nextval(`seq_mfcc`),
+    value DECIMAL            NOT NULL
+) WITH SYSTEM VERSIONING;
+
+INSERT INTO `mfcc` (`value`)
+VALUES (11.2),
+       (11.3),
+       (11.4),
+       (11.9),
+       (12.3),
+       (23.1);
\ No newline at end of file
diff --git a/dbrepo-query-service/rest-service/src/test/resources/init/querystore.sql b/dbrepo-query-service/rest-service/src/test/resources/init/querystore.sql
new file mode 100644
index 0000000000..1bf8b26c55
--- /dev/null
+++ b/dbrepo-query-service/rest-service/src/test/resources/init/querystore.sql
@@ -0,0 +1,5 @@
+CREATE SEQUENCE `qs_queries_seq`;
+CREATE TABLE `qs_queries` ( `id` bigint not null primary key default nextval(`qs_queries_seq`), `created` datetime not null default now(), `executed` datetime not null default now(), `created_by` varchar(255) not null, `query` text not null, `query_normalized` text not null, `is_persisted` boolean not null, `query_hash` varchar(255) not null, `result_hash` varchar(255), `result_number` bigint );
+CREATE PROCEDURE hash_table(IN name VARCHAR(255), OUT hash VARCHAR(255), OUT count BIGINT) BEGIN DECLARE _sql TEXT; SELECT CONCAT('SELECT SHA2(GROUP_CONCAT(CONCAT_WS(\'\',', GROUP_CONCAT(CONCAT('`', column_name, '`') ORDER BY column_name), ') SEPARATOR \',\'), 256) AS hash, COUNT(*) AS count FROM `', name, '` INTO @hash, @count;') FROM `information_schema`.`columns` WHERE `table_schema` = DATABASE() AND `table_name` = name INTO _sql; PREPARE stmt FROM _sql; EXECUTE stmt; DEALLOCATE PREPARE stmt; SET hash = @hash; SET count = @count; END;
+CREATE PROCEDURE store_query(IN query TEXT, IN executed DATETIME, OUT queryId BIGINT) BEGIN DECLARE _queryhash varchar(255) DEFAULT SHA2(query, 256); DECLARE _username varchar(255) DEFAULT REGEXP_REPLACE(current_user(), '@.*', ''); DECLARE _query TEXT DEFAULT CONCAT('CREATE OR REPLACE TABLE _tmp AS (', query, ')'); PREPARE stmt FROM _query; EXECUTE stmt; DEALLOCATE PREPARE stmt; CALL hash_table('_tmp', @hash, @count); IF @hash IS NULL THEN INSERT INTO `qs_queries` (`created_by`, `query`, `query_normalized`, `is_persisted`, `query_hash`, `result_hash`, `result_number`, `executed`) SELECT _username, query, query, false, _queryhash, @hash, @count, executed WHERE NOT EXISTS (SELECT `id` FROM `qs_queries` WHERE `query_hash` = _queryhash AND `result_hash` IS NULL); SET queryId = (SELECT `id` FROM `qs_queries` WHERE `query_hash` = _queryhash AND `result_hash` IS NULL); ELSE INSERT INTO `qs_queries` (`created_by`, `query`, `query_normalized`, `is_persisted`, `query_hash`, `result_hash`, `result_number`, `executed`) SELECT _username, query, query, false, _queryhash, @hash, @count, executed WHERE NOT EXISTS (SELECT `id` FROM `qs_queries` WHERE `query_hash` = _queryhash AND `result_hash` = @hash); SET queryId = (SELECT `id` FROM `qs_queries` WHERE `query_hash` = _queryhash AND `result_hash` = @hash); END IF; END;
+CREATE DEFINER = 'root' PROCEDURE _store_query(IN _username VARCHAR(255), IN query TEXT, IN executed DATETIME, OUT queryId BIGINT) BEGIN DECLARE _queryhash varchar(255) DEFAULT SHA2(query, 256); DECLARE _query TEXT DEFAULT CONCAT('CREATE OR REPLACE TABLE _tmp AS (', query, ')'); PREPARE stmt FROM _query; EXECUTE stmt; DEALLOCATE PREPARE stmt; CALL hash_table('_tmp', @hash, @count); IF @hash IS NULL THEN INSERT INTO `qs_queries` (`created_by`, `query`, `query_normalized`, `is_persisted`, `query_hash`, `result_hash`, `result_number`, `executed`) SELECT _username, query, query, false, _queryhash, @hash, @count, executed WHERE NOT EXISTS (SELECT `id` FROM `qs_queries` WHERE `query_hash` = _queryhash AND `result_hash` IS NULL); SET queryId = (SELECT `id` FROM `qs_queries` WHERE `query_hash` = _queryhash AND `result_hash` IS NULL); ELSE INSERT INTO `qs_queries` (`created_by`, `query`, `query_normalized`, `is_persisted`, `query_hash`, `result_hash`, `result_number`, `executed`) SELECT _username, query, query, false, _queryhash, @hash, @count, executed WHERE NOT EXISTS (SELECT `id` FROM `qs_queries` WHERE `query_hash` = _queryhash AND `result_hash` = @hash); SET queryId = (SELECT `id` FROM `qs_queries` WHERE `query_hash` = _queryhash AND `result_hash` = @hash); END IF; END;
\ No newline at end of file
diff --git a/dbrepo-query-service/rest-service/src/test/resources/init/schema.sql b/dbrepo-query-service/rest-service/src/test/resources/init/schema.sql
new file mode 100644
index 0000000000..f8482e47d5
--- /dev/null
+++ b/dbrepo-query-service/rest-service/src/test/resources/init/schema.sql
@@ -0,0 +1 @@
+CREATE SCHEMA IF NOT EXISTS fda;
\ No newline at end of file
diff --git a/dbrepo-query-service/rest-service/src/test/resources/init/users.sql b/dbrepo-query-service/rest-service/src/test/resources/init/users.sql
new file mode 100644
index 0000000000..45f7b53a0f
--- /dev/null
+++ b/dbrepo-query-service/rest-service/src/test/resources/init/users.sql
@@ -0,0 +1,4 @@
+CREATE USER junit1 IDENTIFIED BY 'junit1';
+CREATE USER junit2 IDENTIFIED BY 'junit2';
+CREATE USER junit3 IDENTIFIED BY 'junit3';
+CREATE USER junit4 IDENTIFIED BY 'junit4';
\ No newline at end of file
diff --git a/dbrepo-query-service/rest-service/src/test/resources/init/weather.sql b/dbrepo-query-service/rest-service/src/test/resources/init/weather.sql
new file mode 100644
index 0000000000..3923462189
--- /dev/null
+++ b/dbrepo-query-service/rest-service/src/test/resources/init/weather.sql
@@ -0,0 +1,70 @@
+/* https://www.kaggle.com/jsphyg/weather-dataset-rattle-package */
+CREATE DATABASE weather;
+USE weather;
+
+CREATE TABLE weather_location
+(
+    location VARCHAR(255) PRIMARY KEY,
+    lat      DOUBLE PRECISION NULL,
+    lng      DOUBLE PRECISION NULL
+) WITH SYSTEM VERSIONING;
+
+CREATE TABLE weather_aus
+(
+    id       BIGINT           NOT NULL PRIMARY KEY,
+    `date`   DATE             NOT NULL,
+    location VARCHAR(255)     NULL,
+    mintemp  DOUBLE PRECISION NULL,
+    rainfall DOUBLE PRECISION NULL,
+    FOREIGN KEY (location) REFERENCES weather_location (location),
+    UNIQUE (`date`),
+    CHECK (`mintemp` > 0)
+) WITH SYSTEM VERSIONING;
+
+CREATE TABLE sensor
+(
+    `timestamp` TIMESTAMP NOT NULL PRIMARY KEY,
+    `value`     DECIMAL
+) WITH SYSTEM VERSIONING;
+
+INSERT INTO weather_location (location, lat, lng)
+VALUES ('Albury', -36.0653583, 146.9112214),
+       ('Sydney', -33.847927, 150.6517942),
+       ('Vienna', null, null);
+
+INSERT INTO weather_aus (id, `date`, location, mintemp, rainfall)
+VALUES (1, '2008-12-01', 'Albury', 13.4, 0.6),
+       (2, '2008-12-02', 'Albury', 7.4, 0),
+       (3, '2008-12-03', 'Albury', 12.9, 0);
+
+INSERT INTO sensor (`timestamp`, value)
+VALUES ('2022-12-24 17:00:00', 10.0),
+       ('2022-12-24 18:00:00', 10.2),
+       ('2022-12-24 19:00:00', null),
+       ('2022-12-24 20:00:00', 10.3),
+       ('2022-12-24 21:00:00', 10.0),
+       ('2022-12-24 22:00:00', null);
+
+/*
+########################################################################################################################
+## TEST CASE PRE-REQUISITE                                                                                            ##
+########################################################################################################################
+*/
+
+CREATE VIEW junit2 AS
+(
+select `date`, `location`, `mintemp`, `rainfall`
+from `weather_aus`
+where `location` = 'Albury');
+
+CREATE VIEW `hs_weather_aus` AS
+SELECT *
+FROM (SELECT `id`, ROW_START AS inserted_at, IF(ROW_END > NOW(), NULL, ROW_END) AS deleted_at, COUNT(*) as total
+      FROM `weather_aus` FOR SYSTEM_TIME ALL
+      GROUP BY inserted_at, deleted_at
+      ORDER BY deleted_at DESC
+      LIMIT 50) AS v
+ORDER BY v.inserted_at, v.deleted_at ASC;
+
+
+COMMIT;
diff --git a/dbrepo-query-service/rest-service/src/test/resources/init/zoo.sql b/dbrepo-query-service/rest-service/src/test/resources/init/zoo.sql
new file mode 100644
index 0000000000..bcf46ea570
--- /dev/null
+++ b/dbrepo-query-service/rest-service/src/test/resources/init/zoo.sql
@@ -0,0 +1,199 @@
+CREATE DATABASE zoo;
+USE zoo;
+
+create sequence seq_zoo_id;
+create sequence seq_names_id;
+create table zoo
+(
+    id          bigint       not null default nextval(`seq_zoo_id`),
+    animal_name varchar(255) null,
+    hair        tinyint(1)   null,
+    feathers    tinyint(1)   null,
+    eggs        tinyint(1)   null,
+    milk        tinyint(1)   null,
+    airborne    tinyint(1)   null,
+    aquatic     tinyint(1)   null,
+    predator    tinyint(1)   null,
+    toothed     tinyint(1)   null,
+    backbone    tinyint(1)   null,
+    breathes    tinyint(1)   null,
+    venomous    tinyint(1)   null,
+    fins        tinyint(1)   null,
+    legs        bigint       null,
+    tail        tinyint(1)   null,
+    domestic    tinyint(1)   null,
+    catsize     tinyint(1)   null,
+    class_type  bigint       null,
+    primary key (id)
+) with system versioning;
+
+create table names
+(
+    id        bigint not null default nextval(`seq_names_id`),
+    firstname varchar(255),
+    lastname  varchar(255),
+    primary key (id),
+    unique key (firstname, lastname)
+) with system versioning;
+
+create table likes
+(
+    name_id bigint not null,
+    zoo_id  bigint not null,
+    primary key (name_id, zoo_id),
+    foreign key (name_id) references names (id),
+    foreign key (zoo_id) references zoo (id)
+) with system versioning;
+
+INSERT INTO zoo (id, animal_name, hair, feathers, eggs, milk, airborne, aquatic, predator, toothed, backbone, breathes,
+                 venomous, fins, legs, tail, domestic, catsize, class_type)
+VALUES (1, 'aardvark', 1, 0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 4, 0, 0, 1, 1),
+       (2, 'antelope', 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 4, 1, 0, 1, 1),
+       (3, 'bass', 0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 0, 4),
+       (4, 'bear', 1, 0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 4, 0, 0, 1, 1),
+       (5, 'boar', 1, 0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 4, 1, 0, 1, 1),
+       (6, 'buffalo', 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 4, 1, 0, 1, 1),
+       (7, 'calf', 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 4, 1, 1, 1, 1),
+       (8, 'carp', 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 4),
+       (9, 'catfish', 0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 0, 4),
+       (10, 'cavy', 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 4, 0, 1, 0, 1),
+       (11, 'cheetah', 1, 0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 4, 1, 0, 1, 1),
+       (12, 'chicken', 0, 1, 1, 0, 1, 0, 0, 0, 1, 1, 0, 0, 2, 1, 1, 0, 2),
+       (13, 'chub', 0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 0, 4),
+       (14, 'clam', 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7),
+       (15, 'crab', 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 4, 0, 0, 0, 7),
+       (16, 'crayfish', 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 6, 0, 0, 0, 7),
+       (17, 'crow', 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 2, 1, 0, 0, 2),
+       (18, 'deer', 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 4, 1, 0, 1, 1),
+       (19, 'dogfish', 0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 4),
+       (20, 'dolphin', 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1),
+       (21, 'dove', 0, 1, 1, 0, 1, 0, 0, 0, 1, 1, 0, 0, 2, 1, 1, 0, 2),
+       (22, 'duck', 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 2, 1, 0, 0, 2),
+       (23, 'elephant', 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 4, 1, 0, 1, 1),
+       (24, 'flamingo', 0, 1, 1, 0, 1, 0, 0, 0, 1, 1, 0, 0, 2, 1, 0, 1, 2),
+       (25, 'flea', 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 6, 0, 0, 0, 6),
+       (26, 'frog', 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 4, 0, 0, 0, 5),
+       (27, 'frog', 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 4, 0, 0, 0, 5),
+       (28, 'fruitbat', 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 2, 1, 0, 0, 1),
+       (29, 'giraffe', 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 4, 1, 0, 1, 1),
+       (30, 'girl', 1, 0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 2, 0, 1, 1, 1),
+       (31, 'gnat', 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 6, 0, 0, 0, 6),
+       (32, 'goat', 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 4, 1, 1, 1, 1),
+       (33, 'gorilla', 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 2, 0, 0, 1, 1),
+       (34, 'gull', 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 2, 1, 0, 0, 2),
+       (35, 'haddock', 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 4),
+       (36, 'hamster', 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 4, 1, 1, 0, 1),
+       (37, 'hare', 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 4, 1, 0, 0, 1),
+       (38, 'hawk', 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 2, 1, 0, 0, 2),
+       (39, 'herring', 0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 0, 4),
+       (40, 'honeybee', 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 6, 0, 1, 0, 6),
+       (41, 'housefly', 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 6, 0, 0, 0, 6),
+       (42, 'kiwi', 0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 2, 1, 0, 0, 2),
+       (43, 'ladybird', 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0, 6, 0, 0, 0, 6),
+       (44, 'lark', 0, 1, 1, 0, 1, 0, 0, 0, 1, 1, 0, 0, 2, 1, 0, 0, 2),
+       (45, 'leopard', 1, 0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 4, 1, 0, 1, 1),
+       (46, 'lion', 1, 0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 4, 1, 0, 1, 1),
+       (47, 'lobster', 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 6, 0, 0, 0, 7),
+       (48, 'lynx', 1, 0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 4, 1, 0, 1, 1),
+       (49, 'mink', 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 4, 1, 0, 1, 1),
+       (50, 'mole', 1, 0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 4, 1, 0, 0, 1),
+       (51, 'mongoose', 1, 0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 4, 1, 0, 1, 1),
+       (52, 'moth', 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 6, 0, 0, 0, 6),
+       (53, 'newt', 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 4, 1, 0, 0, 5),
+       (54, 'octopus', 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 8, 0, 0, 1, 7),
+       (55, 'opossum', 1, 0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 4, 1, 0, 0, 1),
+       (56, 'oryx', 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 4, 1, 0, 1, 1),
+       (57, 'ostrich', 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 2, 1, 0, 1, 2),
+       (58, 'parakeet', 0, 1, 1, 0, 1, 0, 0, 0, 1, 1, 0, 0, 2, 1, 1, 0, 2),
+       (59, 'penguin', 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 2, 1, 0, 1, 2),
+       (60, 'pheasant', 0, 1, 1, 0, 1, 0, 0, 0, 1, 1, 0, 0, 2, 1, 0, 0, 2),
+       (61, 'pike', 0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 4),
+       (62, 'piranha', 0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 0, 4),
+       (63, 'pitviper', 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 3),
+       (64, 'platypus', 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 4, 1, 0, 1, 1),
+       (65, 'polecat', 1, 0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 4, 1, 0, 1, 1),
+       (66, 'pony', 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 4, 1, 1, 1, 1),
+       (67, 'porpoise', 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1),
+       (68, 'puma', 1, 0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 4, 1, 0, 1, 1),
+       (69, 'pussycat', 1, 0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 4, 1, 1, 1, 1),
+       (70, 'raccoon', 1, 0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 4, 1, 0, 1, 1),
+       (71, 'reindeer', 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 4, 1, 1, 1, 1),
+       (72, 'rhea', 0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 2, 1, 0, 1, 2),
+       (73, 'scorpion', 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 8, 1, 0, 0, 7),
+       (74, 'seahorse', 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 4),
+       (75, 'seal', 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1),
+       (76, 'sealion', 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 2, 1, 0, 1, 1),
+       (77, 'seasnake', 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 0, 0, 1, 0, 0, 3),
+       (78, 'seawasp', 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 7),
+       (79, 'skimmer', 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 2, 1, 0, 0, 2),
+       (80, 'skua', 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 2, 1, 0, 0, 2),
+       (81, 'slowworm', 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 3),
+       (82, 'slug', 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 7),
+       (83, 'sole', 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 4),
+       (84, 'sparrow', 0, 1, 1, 0, 1, 0, 0, 0, 1, 1, 0, 0, 2, 1, 0, 0, 2),
+       (85, 'squirrel', 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 2, 1, 0, 0, 1),
+       (86, 'starfish', 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 5, 0, 0, 0, 7),
+       (87, 'stingray', 0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 4),
+       (88, 'swan', 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 2, 1, 0, 1, 2),
+       (89, 'termite', 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 6, 0, 0, 0, 6),
+       (90, 'toad', 0, 0, 1, 0, 0, 1, 0, 1, 1, 1, 0, 0, 4, 0, 0, 0, 5),
+       (91, 'tortoise', 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 4, 1, 0, 1, 3),
+       (92, 'tuatara', 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 4, 1, 0, 0, 3),
+       (93, 'tuna', 0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 4),
+       (94, 'vampire', 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 2, 1, 0, 0, 1),
+       (95, 'vole', 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 4, 1, 0, 0, 1),
+       (96, 'vulture', 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 2, 1, 0, 1, 2),
+       (97, 'wallaby', 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 2, 1, 0, 1, 1),
+       (98, 'wasp', 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 6, 0, 0, 0, 6),
+       (99, 'wolf', 1, 0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 4, 1, 0, 1, 1),
+       (100, 'worm', 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 7),
+       (101, 'wren', 0, 1, 1, 0, 1, 0, 0, 0, 1, 1, 0, 0, 2, 1, 0, 0, 2);
+
+INSERT INTO names (firstname, lastname)
+VALUES ('Moritz', 'Staudinger'),
+       ('Martin', 'Weise'),
+       ('Eva', 'Gergely'),
+       ('Cornelia', 'Michlits'),
+       ('Kirill', 'Stytsenko');
+
+INSERT INTO likes (name_id, zoo_id)
+VALUES (1, 5),
+       (1, 10),
+       (2, 3),
+       (2, 80),
+       (3, 4),
+       (4, 4),
+       (5, 100);
+
+/*
+########################################################################################################################
+## TEST CASE PRE-REQUISITE                                                                                            ##
+########################################################################################################################
+*/
+
+CREATE VIEW mock_view AS
+(
+SELECT `id`,
+       `animal_name`,
+       `hair`,
+       `feathers`,
+       `eggs`,
+       `milk`,
+       `airborne`,
+       `aquatic`,
+       `predator`,
+       `toothed`,
+       `backbone`,
+       `breathes`,
+       `venomous`,
+       `fins`,
+       `legs`,
+       `tail`,
+       `domestic`,
+       `catsize`,
+       `class_type`
+FROM `zoo`
+WHERE `class_type` = 1);
+
+
+COMMIT;
diff --git a/dbrepo-query-service/rest-service/src/test/resources/sensor/1_querystore.sql b/dbrepo-query-service/rest-service/src/test/resources/sensor/1_querystore.sql
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/dbrepo-query-service/rest-service/src/test/resources/sensor/2_traffic.sql b/dbrepo-query-service/rest-service/src/test/resources/sensor/2_traffic.sql
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/dbrepo-query-service/rest-service/src/test/resources/traffic/1_querystore.sql b/dbrepo-query-service/rest-service/src/test/resources/traffic/1_querystore.sql
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/dbrepo-query-service/rest-service/src/test/resources/traffic/2_traffic.sql b/dbrepo-query-service/rest-service/src/test/resources/traffic/2_traffic.sql
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/dbrepo-query-service/rest-service/src/test/resources/weather/1_querystore.sql b/dbrepo-query-service/rest-service/src/test/resources/weather/1_querystore.sql
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/dbrepo-query-service/rest-service/src/test/resources/weather/2_weather.sql b/dbrepo-query-service/rest-service/src/test/resources/weather/2_weather.sql
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/dbrepo-query-service/rest-service/src/test/resources/zoo/1_querystore.sql b/dbrepo-query-service/rest-service/src/test/resources/zoo/1_querystore.sql
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/dbrepo-query-service/rest-service/src/test/resources/zoo/2_zoo.sql b/dbrepo-query-service/rest-service/src/test/resources/zoo/2_zoo.sql
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/dbrepo-query-service/services/src/main/java/at/tuwien/amqp/RabbitMqConsumer.java b/dbrepo-query-service/services/src/main/java/at/tuwien/amqp/RabbitMqConsumer.java
index f7203ac70a..0f32e23535 100644
--- a/dbrepo-query-service/services/src/main/java/at/tuwien/amqp/RabbitMqConsumer.java
+++ b/dbrepo-query-service/services/src/main/java/at/tuwien/amqp/RabbitMqConsumer.java
@@ -1,7 +1,6 @@
 package at.tuwien.amqp;
 
 import at.tuwien.api.database.table.TableCsvDto;
-import at.tuwien.entities.database.table.Table;
 import at.tuwien.exception.*;
 import at.tuwien.service.QueryService;
 import com.fasterxml.jackson.core.type.TypeReference;
@@ -21,15 +20,12 @@ import java.util.HashMap;
 @Log4j2
 public class RabbitMqConsumer implements Consumer {
 
-    private final Long containerId;
     private final Long databaseId;
     private final Long tableId;
     private final ObjectMapper objectMapper;
     private final QueryService queryService;
 
-    public RabbitMqConsumer(Long containerId, Long databaseId, Long tableId, ObjectMapper objectMapper,
-                            QueryService queryService) {
-        this.containerId = containerId;
+    public RabbitMqConsumer(Long databaseId, Long tableId, ObjectMapper objectMapper, QueryService queryService) {
         this.databaseId = databaseId;
         this.tableId = tableId;
         this.objectMapper = objectMapper;
@@ -74,7 +70,7 @@ public class RabbitMqConsumer implements Consumer {
                 .build();
         log.trace("received tuple data {}", data);
         try {
-            queryService.insert(containerId, databaseId, tableId, data, new BasicUserPrincipal(properties.getUserId()));
+            queryService.insert(databaseId, tableId, data, new BasicUserPrincipal(properties.getUserId()));
         } catch (HttpClientErrorException.Unauthorized e) {
             log.error("Failed to authenticate for table with id {}, reason: {}", tableId, e.getMessage());
             throw new IOException("Failed to authenticate for table", e);
@@ -93,11 +89,8 @@ public class RabbitMqConsumer implements Consumer {
         } catch (ImageNotSupportedException e) {
             log.error("Image is not supported");
             throw new IOException("Image is not supported", e);
-        } catch (ContainerNotFoundException e) {
-            log.error("Failed to find container with id {}, reason: {}", containerId, e.getMessage());
-            throw new IOException("Failed to find container", e);
         } catch (DatabaseConnectionException e) {
-            log.error("Failed to connect to container with id {}, reason: {}", containerId, e.getMessage());
+            log.error("Failed to connect to database, reason: {}", e.getMessage());
             throw new IOException("Failed to connect to container", e);
         } catch (UserNotFoundException e) {
             log.error("Failed to find user with id {}", properties.getUserId());
diff --git a/dbrepo-query-service/services/src/main/java/at/tuwien/config/AmqpConfig.java b/dbrepo-query-service/services/src/main/java/at/tuwien/config/AmqpConfig.java
index 4d827c2250..0d2f0d1c1a 100644
--- a/dbrepo-query-service/services/src/main/java/at/tuwien/config/AmqpConfig.java
+++ b/dbrepo-query-service/services/src/main/java/at/tuwien/config/AmqpConfig.java
@@ -20,6 +20,9 @@ public class AmqpConfig {
     @Value("${spring.rabbitmq.host}")
     private String ampqHost;
 
+    @Value("${spring.rabbitmq.port:5672}")
+    private int ampqPort;
+
     @Value("${spring.rabbitmq.virtual-host}")
     private String virtualHost;
 
@@ -36,6 +39,7 @@ public class AmqpConfig {
     public ConnectionFactory connectionFactory() {
         final ConnectionFactory factory = new ConnectionFactory();
         factory.setHost(ampqHost);
+        factory.setPort(ampqPort);
         factory.setVirtualHost(virtualHost);
         factory.setUsername(amqpUsername);
         factory.setPassword(amqpPassword);
diff --git a/dbrepo-query-service/services/src/main/java/at/tuwien/config/WebSecurityConfig.java b/dbrepo-query-service/services/src/main/java/at/tuwien/config/WebSecurityConfig.java
index b6fab51c6d..968799322e 100644
--- a/dbrepo-query-service/services/src/main/java/at/tuwien/config/WebSecurityConfig.java
+++ b/dbrepo-query-service/services/src/main/java/at/tuwien/config/WebSecurityConfig.java
@@ -3,6 +3,7 @@ package at.tuwien.config;
 import at.tuwien.auth.AuthTokenFilter;
 import io.swagger.v3.oas.annotations.enums.SecuritySchemeType;
 import io.swagger.v3.oas.annotations.security.SecurityScheme;
+import jakarta.servlet.http.HttpServletResponse;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
@@ -17,8 +18,6 @@ import org.springframework.web.cors.CorsConfiguration;
 import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
 import org.springframework.web.filter.CorsFilter;
 
-import jakarta.servlet.http.HttpServletResponse;
-
 @Configuration
 @EnableWebSecurity
 @EnableGlobalMethodSecurity(prePostEnabled = true)
@@ -45,14 +44,14 @@ public class WebSecurityConfig {
                 new AntPathRequestMatcher("/swagger-ui.html")
         );
         final OrRequestMatcher publicEndpoints = new OrRequestMatcher(
-                new AntPathRequestMatcher("/api/container/**/database/data/**", "GET"),
-                new AntPathRequestMatcher("/api/container/**/database/**/table/**/data/**", "GET"),
-                new AntPathRequestMatcher("/api/container/**/database/**/view/**", "GET"),
-                new AntPathRequestMatcher("/api/container/**/database/**/table/**/history/**", "GET"),
-                new AntPathRequestMatcher("/api/container/**/database/**/table/**/export/**", "GET"),
-                new AntPathRequestMatcher("/api/container/**/database/**/query/**", "GET"),
-                new AntPathRequestMatcher("/api/container/**/database/**/query/**/export", "GET"),
-                new AntPathRequestMatcher("/api/container/**/database/**/query/**", "PUT")
+                new AntPathRequestMatcher("/api/database/data/**", "GET"),
+                new AntPathRequestMatcher("/api/database/**/table/**/data/**", "GET"),
+                new AntPathRequestMatcher("/api/database/**/view/**", "GET"),
+                new AntPathRequestMatcher("/api/database/**/table/**/history/**", "GET"),
+                new AntPathRequestMatcher("/api/database/**/table/**/export/**", "GET"),
+                new AntPathRequestMatcher("/api/database/**/query/**", "GET"),
+                new AntPathRequestMatcher("/api/database/**/query/**/export", "GET"),
+                new AntPathRequestMatcher("/api/database/**/query/**", "PUT")
         );
         /* enable CORS and disable CSRF */
         http = http.cors().and().csrf().disable();
diff --git a/dbrepo-query-service/services/src/main/java/at/tuwien/mapper/DatabaseMapper.java b/dbrepo-query-service/services/src/main/java/at/tuwien/mapper/DatabaseMapper.java
deleted file mode 100644
index 88d98a6706..0000000000
--- a/dbrepo-query-service/services/src/main/java/at/tuwien/mapper/DatabaseMapper.java
+++ /dev/null
@@ -1,39 +0,0 @@
-package at.tuwien.mapper;
-
-import at.tuwien.entities.container.Container;
-import at.tuwien.entities.container.image.ContainerImageEnvironmentItem;
-import at.tuwien.entities.container.image.ContainerImageEnvironmentItemType;
-import at.tuwien.entities.user.User;
-import org.mapstruct.Mapper;
-import org.springframework.transaction.annotation.Transactional;
-
-import java.util.stream.Collectors;
-
-@Mapper(componentModel = "spring")
-public interface DatabaseMapper {
-
-    org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(DatabaseMapper.class);
-
-    @Transactional(readOnly = true)
-    default User containerToPrivilegedUser(Container container) {
-        final String username = container.getImage()
-                .getEnvironment()
-                .stream()
-                .filter(e -> e.getType().equals(ContainerImageEnvironmentItemType.PRIVILEGED_USERNAME))
-                .map(ContainerImageEnvironmentItem::getValue)
-                .collect(Collectors.toList())
-                .get(0);
-        final String password = container.getImage()
-                .getEnvironment()
-                .stream()
-                .filter(e -> e.getType().equals(ContainerImageEnvironmentItemType.PRIVILEGED_PASSWORD))
-                .map(ContainerImageEnvironmentItem::getValue)
-                .collect(Collectors.toList())
-                .get(0);
-        return User.builder()
-                .username(username)
-                .databasePassword(password)
-                .build();
-    }
-
-}
diff --git a/dbrepo-query-service/services/src/main/java/at/tuwien/mapper/QueryMapper.java b/dbrepo-query-service/services/src/main/java/at/tuwien/mapper/QueryMapper.java
index 63acb8522a..471403d424 100644
--- a/dbrepo-query-service/services/src/main/java/at/tuwien/mapper/QueryMapper.java
+++ b/dbrepo-query-service/services/src/main/java/at/tuwien/mapper/QueryMapper.java
@@ -1,20 +1,23 @@
 package at.tuwien.mapper;
 
-import at.tuwien.api.database.query.*;
+import at.tuwien.api.database.query.ImportDto;
+import at.tuwien.api.database.query.QueryBriefDto;
+import at.tuwien.api.database.query.QueryDto;
+import at.tuwien.api.database.query.QueryResultDto;
 import at.tuwien.api.database.table.TableCsvDeleteDto;
 import at.tuwien.api.database.table.TableCsvDto;
 import at.tuwien.api.database.table.TableCsvUpdateDto;
 import at.tuwien.api.database.table.TableHistoryDto;
 import at.tuwien.entities.database.Database;
 import at.tuwien.entities.database.View;
+import at.tuwien.entities.database.table.Table;
+import at.tuwien.entities.database.table.columns.TableColumn;
 import at.tuwien.entities.database.table.columns.TableColumnType;
+import at.tuwien.exception.ImageNotSupportedException;
 import at.tuwien.exception.QueryMalformedException;
 import at.tuwien.exception.QueryStoreException;
 import at.tuwien.exception.TableMalformedException;
 import at.tuwien.querystore.Query;
-import at.tuwien.entities.database.table.Table;
-import at.tuwien.entities.database.table.columns.TableColumn;
-import at.tuwien.exception.ImageNotSupportedException;
 import net.sf.jsqlparser.statement.select.SelectItem;
 import org.mapstruct.Mapper;
 import org.mapstruct.Mapping;
@@ -24,8 +27,8 @@ import org.mariadb.jdbc.MariaDbBlob;
 import org.springframework.transaction.annotation.Transactional;
 
 import java.math.BigInteger;
-import java.sql.*;
 import java.sql.Date;
+import java.sql.*;
 import java.text.Normalizer;
 import java.time.*;
 import java.time.format.DateTimeFormatter;
@@ -402,7 +405,7 @@ public interface QueryMapper {
             throw new TableMalformedException("Columns are not known");
         }
         /* check image */
-        if (!table.getDatabase().getContainer().getImage().getRepository().equals("mariadb")) {
+        if (!table.getDatabase().getContainer().getImage().getName().equals("mariadb")) {
             log.error("Currently only MariaDB is supported");
             throw new ImageNotSupportedException("Image not supported.");
         }
@@ -461,7 +464,7 @@ public interface QueryMapper {
             throw new TableMalformedException("Columns are not known");
         }
         /* check image */
-        if (!table.getDatabase().getContainer().getImage().getRepository().equals("mariadb")) {
+        if (!table.getDatabase().getContainer().getImage().getName().equals("mariadb")) {
             log.error("Currently only MariaDB is supported");
             throw new ImageNotSupportedException("Image not supported.");
         }
@@ -508,7 +511,7 @@ public interface QueryMapper {
             throw new TableMalformedException("Columns are not known");
         }
         /* check image */
-        if (!table.getDatabase().getContainer().getImage().getRepository().equals("mariadb")) {
+        if (!table.getDatabase().getContainer().getImage().getName().equals("mariadb")) {
             log.error("Currently only MariaDB is supported");
             throw new ImageNotSupportedException("Image not supported.");
         }
@@ -579,7 +582,7 @@ public interface QueryMapper {
             throws ImageNotSupportedException {
         log.trace("mapping table to raw count query, table={}, timestamp={}", table, timestamp);
         /* check image */
-        if (!table.getDatabase().getContainer().getImage().getRepository().equals("mariadb")) {
+        if (!table.getDatabase().getContainer().getImage().getName().equals("mariadb")) {
             log.error("Currently only MariaDB is supported");
             throw new ImageNotSupportedException("Image not supported.");
         }
@@ -594,7 +597,7 @@ public interface QueryMapper {
             throws ImageNotSupportedException {
         log.trace("mapping table to raw count query, view={}", view);
         /* check image */
-        if (!view.getDatabase().getContainer().getImage().getRepository().equals("mariadb")) {
+        if (!view.getDatabase().getContainer().getImage().getName().equals("mariadb")) {
             log.error("Currently only MariaDB is supported");
             throw new ImageNotSupportedException("Image not supported.");
         }
@@ -619,7 +622,7 @@ public interface QueryMapper {
         log.trace("mapping query to timestamped query, query={}, database={}, timestamp={}, selection={}, page={}, size={}",
                 query, database, timestamp, selection, page, size);
         /* param check */
-        if (!database.getContainer().getImage().getRepository().equals("mariadb")) {
+        if (!database.getContainer().getImage().getName().equals("mariadb")) {
             log.error("Currently only MariaDB is supported");
             throw new ImageNotSupportedException("Currently only MariaDB is supported");
         }
@@ -678,7 +681,7 @@ public interface QueryMapper {
         log.trace("mapping table to find all query, table={}, timestamp={}, size={}, page={}",
                 table, timestamp, size, page);
         /* param check */
-        if (!table.getDatabase().getContainer().getImage().getRepository().equals("mariadb")) {
+        if (!table.getDatabase().getContainer().getImage().getName().equals("mariadb")) {
             log.error("Currently only MariaDB is supported");
             throw new ImageNotSupportedException("Currently only MariaDB is supported");
         }
@@ -695,7 +698,7 @@ public interface QueryMapper {
             throws ImageNotSupportedException {
         log.trace("mapping view to find all query, view={}, size={}, page={}", view, size, page);
         /* param check */
-        if (!view.getDatabase().getContainer().getImage().getRepository().equals("mariadb")) {
+        if (!view.getDatabase().getContainer().getImage().getName().equals("mariadb")) {
             log.error("Currently only MariaDB is supported");
             throw new ImageNotSupportedException("Currently only MariaDB is supported");
         }
diff --git a/dbrepo-query-service/services/src/main/java/at/tuwien/repository/mdb/DatabaseRepository.java b/dbrepo-query-service/services/src/main/java/at/tuwien/repository/mdb/DatabaseRepository.java
index e5b21ce646..ae627d68aa 100644
--- a/dbrepo-query-service/services/src/main/java/at/tuwien/repository/mdb/DatabaseRepository.java
+++ b/dbrepo-query-service/services/src/main/java/at/tuwien/repository/mdb/DatabaseRepository.java
@@ -11,8 +11,8 @@ import java.util.Optional;
 @Repository
 public interface DatabaseRepository extends JpaRepository<Database, Long> {
 
-    @Query(value = "select d from Database d where d.container.id = :containerId and d.id = :databaseId")
-    Optional<Database> findByContainerIdAndDatabaseId(@Param("containerId") Long containerId, @Param("databaseId") Long databaseId);
+    @Query(value = "select d from Database d where d.id = :databaseId")
+    Optional<Database> findByDatabaseId(@Param("databaseId") Long databaseId);
 
 }
 
diff --git a/dbrepo-query-service/services/src/main/java/at/tuwien/repository/mdb/TableRepository.java b/dbrepo-query-service/services/src/main/java/at/tuwien/repository/mdb/TableRepository.java
index e4fe63d623..3a85db2588 100644
--- a/dbrepo-query-service/services/src/main/java/at/tuwien/repository/mdb/TableRepository.java
+++ b/dbrepo-query-service/services/src/main/java/at/tuwien/repository/mdb/TableRepository.java
@@ -12,8 +12,7 @@ import java.util.Optional;
 @Repository
 public interface TableRepository extends JpaRepository<Table, TableKey> {
 
-    @Query(value = "select t from Table t where t.database.container.id = :containerId and t.database.id = :databaseId and t.id = :tableId")
-    Optional<Table> find(@Param("containerId") Long containerId, @Param("databaseId") Long databaseId,
-                         @Param("tableId") Long tableId);
+    @Query(value = "select t from Table t where t.database.id = :databaseId and t.id = :tableId")
+    Optional<Table> find(@Param("databaseId") Long databaseId, @Param("tableId") Long tableId);
 
 }
diff --git a/dbrepo-query-service/services/src/main/java/at/tuwien/service/DatabaseService.java b/dbrepo-query-service/services/src/main/java/at/tuwien/service/DatabaseService.java
index 80694cf22f..52009936dc 100644
--- a/dbrepo-query-service/services/src/main/java/at/tuwien/service/DatabaseService.java
+++ b/dbrepo-query-service/services/src/main/java/at/tuwien/service/DatabaseService.java
@@ -2,7 +2,6 @@ package at.tuwien.service;
 
 import at.tuwien.entities.database.Database;
 import at.tuwien.exception.DatabaseNotFoundException;
-import org.springframework.transaction.annotation.Transactional;
 
 import java.util.List;
 
@@ -11,12 +10,11 @@ public interface DatabaseService {
     /**
      * Finds a database by given id in the metadata database.
      *
-     * @param containerId The container id.
      * @param databaseId  The database id.
      * @return The database.
      * @throws DatabaseNotFoundException The database was not found.
      */
-    Database find(Long containerId, Long databaseId) throws DatabaseNotFoundException;
+    Database find(Long databaseId) throws DatabaseNotFoundException;
 
     /**
      * Finds all databases stored in the metadata database.
diff --git a/dbrepo-query-service/services/src/main/java/at/tuwien/service/MessageQueueService.java b/dbrepo-query-service/services/src/main/java/at/tuwien/service/MessageQueueService.java
index ed4342ddd4..b9223bf99e 100644
--- a/dbrepo-query-service/services/src/main/java/at/tuwien/service/MessageQueueService.java
+++ b/dbrepo-query-service/services/src/main/java/at/tuwien/service/MessageQueueService.java
@@ -1,6 +1,5 @@
 package at.tuwien.service;
 
-import at.tuwien.entities.database.table.Table;
 import at.tuwien.exception.AmqpException;
 
 public interface MessageQueueService {
@@ -9,12 +8,11 @@ public interface MessageQueueService {
      * Creates a consumer on the provided queue with name and container id and database id for table id.
      *
      * @param queueName   The queue name.
-     * @param containerId The container id.
      * @param databaseId  The database id.
      * @param tableId     The table id.
      * @throws AmqpException The consumer could not be created.
      */
-    void createConsumer(String queueName, Long containerId, Long databaseId, Long tableId) throws AmqpException;
+    void createConsumer(String queueName, Long databaseId, Long tableId) throws AmqpException;
 
     /**
      * Restores missing consumers at the Broker Service.
diff --git a/dbrepo-query-service/services/src/main/java/at/tuwien/service/QueryService.java b/dbrepo-query-service/services/src/main/java/at/tuwien/service/QueryService.java
index b975235b5b..ccd997e773 100644
--- a/dbrepo-query-service/services/src/main/java/at/tuwien/service/QueryService.java
+++ b/dbrepo-query-service/services/src/main/java/at/tuwien/service/QueryService.java
@@ -24,10 +24,9 @@ import java.util.List;
 public interface QueryService {
 
     /**
-     * Executes an arbitrary query on the database container. We allow the user to only view the data, therefore the
+     * Executes an arbitrary query on the database. We allow the user to only view the data, therefore the
      * default "mariadb" user is allowed read-only access "SELECT".
      *
-     * @param containerId   The container id.
      * @param databaseId    The database id.
      * @param statement     The query.
      * @param principal     The current user.
@@ -40,20 +39,18 @@ public interface QueryService {
      * @throws QueryMalformedException    The query is malformed.
      * @throws DatabaseNotFoundException  The database was not found in the metdata database.
      * @throws ImageNotSupportedException The image is not supported.
-     * @throws ContainerNotFoundException The container was not found in the metadata database.
      * @throws QueryMalformedException    The query is malformed.
      */
-    QueryResultDto execute(Long containerId, Long databaseId, ExecuteStatementDto statement,
+    QueryResultDto execute(Long databaseId, ExecuteStatementDto statement,
                            Principal principal, Long page, Long size,
                            SortType sortDirection, String sortColumn) throws DatabaseNotFoundException,
-            ImageNotSupportedException, QueryMalformedException, QueryStoreException, ContainerNotFoundException,
+            ImageNotSupportedException, QueryMalformedException, QueryStoreException,
             ColumnParseException, UserNotFoundException, TableMalformedException, DatabaseConnectionException;
 
     /**
-     * Re-Executes an arbitrary query on the database container. We allow the user to only view the data, therefore the
+     * Re-Executes an arbitrary query on the database. We allow the user to only view the data, therefore the
      * default "mariadb" user is allowed read-only access "SELECT".
      *
-     * @param containerId   The container id.
      * @param databaseId    The database id.
      * @param query         The query.
      * @param page          The page number.
@@ -70,16 +67,15 @@ public interface QueryService {
      * @throws ColumnParseException       The column mapping/parsing failed.
      * @throws QueryMalformedException    The query is malformed.
      */
-    QueryResultDto reExecute(Long containerId, Long databaseId, Query query, Long page, Long size,
+    QueryResultDto reExecute(Long databaseId, Query query, Long page, Long size,
                              SortType sortDirection, String sortColumn, Principal principal)
             throws QueryMalformedException, DatabaseNotFoundException, ImageNotSupportedException, ColumnParseException,
             DatabaseConnectionException, TableMalformedException, QueryStoreException, UserNotFoundException;
 
     /**
-     * Re-Executes the count-statement of an arbitrary query on the database container. We allow the user to only view
+     * Re-Executes the count-statement of an arbitrary query on the database. We allow the user to only view
      * the data, therefore the default "mariadb" user is allowed read-only access "SELECT".
      *
-     * @param containerId   The container id.
      * @param databaseId    The database id.
      * @param query         The query.
      * @param principal     The user principal.
@@ -91,7 +87,7 @@ public interface QueryService {
      * @throws TableMalformedException    The table is malformed.
      * @throws ColumnParseException       The column mapping/parsing failed.
      */
-    Long reExecuteCount(Long containerId, Long databaseId, Query query, Principal principal)
+    Long reExecuteCount(Long databaseId, Query query, Principal principal)
             throws QueryMalformedException, DatabaseNotFoundException, ImageNotSupportedException, ColumnParseException,
             TableMalformedException, QueryStoreException;
 
@@ -99,8 +95,7 @@ public interface QueryService {
      * Select all data known in the database-table id tuple at a given time and return a page of specific size, using
      * Instant to better abstract time concept (JDK 8) from SQL. We use the "mariadb" user for this.
      *
-     * @param containerId The container-database id pair.
-     * @param databaseId  The container-database id pair.
+     * @param databaseId  The database id.
      * @param tableId     The table id.
      * @param timestamp   The given time.
      * @param page        The page.
@@ -110,27 +105,24 @@ public interface QueryService {
      * @throws TableNotFoundException     The table was not found in the metadata database.
      * @throws DatabaseNotFoundException  The database was not found in the metdata database.
      * @throws ImageNotSupportedException The image is not supported.
-     * @throws ContainerNotFoundException The container was not found in the metadata database.
      * @throws TableMalformedException    The table is malformed.
      * @throws QueryMalformedException    The query is malformed.
      */
-    QueryResultDto tableFindAll(Long containerId, Long databaseId, Long tableId, Instant timestamp,
+    QueryResultDto tableFindAll(Long databaseId, Long tableId, Instant timestamp,
                                 Long page, Long size, Principal principal) throws TableNotFoundException, DatabaseNotFoundException,
             ImageNotSupportedException, DatabaseConnectionException, TableMalformedException, PaginationException,
-            ContainerNotFoundException, QueryMalformedException, UserNotFoundException;
+            QueryMalformedException, UserNotFoundException;
 
     /**
      * Select all data known in the database-table id tuple at a given time and return a downloadable input stream
      * resource at a given time. Instant to better abstract time concept (JDK 8) from SQL. We use the "mariadb" user
      * for this.
      *
-     * @param containerId The container-database id pair.
-     * @param databaseId  The container-database id pair.
+     * @param databaseId  The database id.
      * @param tableId     The table id.
      * @param timestamp   The given time.
      * @param principal   The user principal.
      * @return The select all data result in the form of a downloadable .csv file.
-     * @throws ContainerNotFoundException  The container was not found in the metadata database.
      * @throws TableNotFoundException      The table was not found in the metadata database.
      * @throws TableMalformedException     The table columns are messed up what we got from the metadata database.
      * @throws DatabaseNotFoundException   The database was not found in the remote database.
@@ -139,17 +131,16 @@ public interface QueryService {
      * @throws FileStorageException        The file could not be exported.
      * @throws QueryMalformedException     The query is malformed.
      */
-    ExportResource tableFindAll(Long containerId, Long databaseId, Long tableId, Instant timestamp, Principal principal)
+    ExportResource tableFindAll(Long databaseId, Long tableId, Instant timestamp, Principal principal)
             throws TableNotFoundException, DatabaseNotFoundException, ImageNotSupportedException,
-            DatabaseConnectionException, TableMalformedException, PaginationException, ContainerNotFoundException,
+            DatabaseConnectionException, TableMalformedException, PaginationException,
             FileStorageException, QueryMalformedException, UserNotFoundException;
 
     /**
      * Select all data known in the view id tuple and return a page of specific size.
      * We use the "mariadb" user for this.
      *
-     * @param containerId The container-database id pair.
-     * @param databaseId  The container-database id pair.
+     * @param databaseId  The database id.
      * @param view        The view.
      * @param page        The page.
      * @param size        The page size.
@@ -158,19 +149,17 @@ public interface QueryService {
      * @throws ViewNotFoundException     The view was not found in the metadata database.
      * @throws DatabaseNotFoundException  The database was not found in the metdata database.
      * @throws ImageNotSupportedException The image is not supported.
-     * @throws ContainerNotFoundException The container was not found in the metadata database.
      * @throws ViewMalformedException    The table is malformed.
      * @throws QueryMalformedException    The query is malformed.
      */
-    QueryResultDto viewFindAll(Long containerId, Long databaseId, View view,
+    QueryResultDto viewFindAll(Long databaseId, View view,
                                Long page, Long size, Principal principal) throws ViewNotFoundException, DatabaseNotFoundException,
             ImageNotSupportedException, DatabaseConnectionException, ViewMalformedException, PaginationException,
-            ContainerNotFoundException, QueryMalformedException, UserNotFoundException, TableMalformedException;
+            QueryMalformedException, UserNotFoundException, TableMalformedException;
 
     /**
-     * Finds one query by container-database-query triple.
+     * Finds one query by database id and query id.
      *
-     * @param containerId The container id.
      * @param databaseId  The database id.
      * @param queryId     The query id.
      * @param principal   The user principal.
@@ -178,54 +167,46 @@ public interface QueryService {
      * @throws DatabaseNotFoundException  The database was not found in the remote database.
      * @throws ImageNotSupportedException The image is not supported.
      * @throws TableMalformedException    The table columns are messed up what we got from the metadata database.
-     * @throws ContainerNotFoundException The container was not found in the metadata database.
      * @throws FileStorageException       The file could not be exported.
      * @throws QueryStoreException        The query store is not reachable.
      * @throws QueryNotFoundException     THe query was not found in the query store.
      * @throws QueryMalformedException    The query is malformed.
      */
-    ExportResource findOne(Long containerId, Long databaseId, Long queryId, Principal principal)
+    ExportResource findOne(Long databaseId, Long queryId, Principal principal)
             throws DatabaseNotFoundException, ImageNotSupportedException, TableMalformedException,
-            ContainerNotFoundException, FileStorageException, QueryStoreException, QueryNotFoundException, QueryMalformedException, DatabaseConnectionException, UserNotFoundException;
+            FileStorageException, QueryStoreException, QueryNotFoundException, QueryMalformedException, DatabaseConnectionException, UserNotFoundException;
 
     /**
-     * Count the total tuples for a given table id within a container-database id tuple at a given time.
+     * Count the total tuples for a given table id within a database id at a given time.
      *
-     * @param containerId The container id.
      * @param databaseId  The database id.
      * @param tableId     The table id.
      * @param timestamp   The time.
      * @param principal   The user principal.
      * @return The number of records, if successful
-     * @throws ContainerNotFoundException The container was not found in the metadata database.
      * @throws DatabaseNotFoundException  The database was not found in the remote database.
      * @throws TableNotFoundException     The table was not found in the metadata database.
      * @throws TableMalformedException    The table columns are messed up what we got from the metadata database.
      * @throws ImageNotSupportedException The image is not supported.
      */
-    Long tableCount(Long containerId, Long databaseId, Long tableId, Instant timestamp, Principal principal)
-            throws ContainerNotFoundException, DatabaseNotFoundException, TableNotFoundException,
-            TableMalformedException, ImageNotSupportedException, DatabaseConnectionException, QueryMalformedException, QueryStoreException, UserNotFoundException;
+    Long tableCount(Long databaseId, Long tableId, Instant timestamp, Principal principal)
+            throws DatabaseNotFoundException, TableNotFoundException, TableMalformedException, ImageNotSupportedException, DatabaseConnectionException, QueryMalformedException, QueryStoreException, UserNotFoundException;
 
     /**
-     * Count the total tuples for a given table id within a container-database id tuple at a given time.
+     * Count the total tuples for a given table id within a database id at a given time.
      *
-     * @param containerId The container id.
      * @param databaseId  The database id.
      * @param view        The view.
      * @param principal   The user principal.
      * @return The number of records, if successful
-     * @throws ContainerNotFoundException The container was not found in the metadata database.
      * @throws DatabaseNotFoundException  The database was not found in the remote database.
      * @throws TableMalformedException    The view columns are messed up what we got from the metadata database.
      * @throws ImageNotSupportedException The image is not supported.
      */
-    Long viewCount(Long containerId, Long databaseId, View view, Principal principal)
-            throws ContainerNotFoundException, DatabaseNotFoundException,
-            TableMalformedException, ImageNotSupportedException, DatabaseConnectionException, QueryMalformedException, QueryStoreException, UserNotFoundException;
+    Long viewCount(Long databaseId, View view, Principal principal)
+            throws DatabaseNotFoundException, TableMalformedException, ImageNotSupportedException, DatabaseConnectionException, QueryMalformedException, QueryStoreException, UserNotFoundException;
 
     /**
-     * @param containerId The container id.
      * @param databaseId  The database id.
      * @param tableId     The table id.
      * @param data
@@ -238,7 +219,7 @@ public interface QueryService {
      * @throws QueryMalformedException     The query is malformed.
      */
     @Deprecated
-    void update(Long containerId, Long databaseId, Long tableId, TableCsvUpdateDto data, Principal principal)
+    void update(Long databaseId, Long tableId, TableCsvUpdateDto data, Principal principal)
             throws ImageNotSupportedException, TableMalformedException, DatabaseNotFoundException,
             TableNotFoundException, DatabaseConnectionException, QueryMalformedException, UserNotFoundException;
 
@@ -246,7 +227,6 @@ public interface QueryService {
      * Insert data from AMQP client into a table of a table-database id tuple, we need the "root" role for this as the
      * default "mariadb" user is configured to only be allowed to execute "SELECT" statements.
      *
-     * @param containerId The container id.
      * @param databaseId  The database id.
      * @param tableId     The table id.
      * @param data        The data.
@@ -255,15 +235,13 @@ public interface QueryService {
      * @throws TableMalformedException    The table does not exist in the metadata database.
      * @throws DatabaseNotFoundException  The database is not found in the metadata database.
      * @throws TableNotFoundException     The table is not found in the metadata database.
-     * @throws ContainerNotFoundException The container was not found in the metadata database.
      */
-    void insert(Long containerId, Long databaseId, Long tableId, TableCsvDto data, Principal principal) throws ImageNotSupportedException,
-            TableMalformedException, DatabaseNotFoundException, TableNotFoundException, ContainerNotFoundException, DatabaseConnectionException, UserNotFoundException;
+    void insert(Long databaseId, Long tableId, TableCsvDto data, Principal principal) throws ImageNotSupportedException,
+            TableMalformedException, DatabaseNotFoundException, TableNotFoundException, DatabaseConnectionException, UserNotFoundException;
 
     /**
      * Deletes a tuple by given constraint set
      *
-     * @param containerId The container id.
      * @param databaseId  The database id.
      * @param tableId     The table id.
      * @param data        The constraint set.
@@ -274,9 +252,9 @@ public interface QueryService {
      * @throws TableNotFoundException     The table is not found in the metadata database.
      * @throws QueryMalformedException    The query is malformed.
      */
-    void delete(Long containerId, Long databaseId, Long tableId, TableCsvDeleteDto data, Principal principal)
+    void delete(Long databaseId, Long tableId, TableCsvDeleteDto data, Principal principal)
             throws ImageNotSupportedException, TableMalformedException, DatabaseNotFoundException,
-            TableNotFoundException, ContainerNotFoundException, DatabaseConnectionException, QueryMalformedException, UserNotFoundException;
+            TableNotFoundException, DatabaseConnectionException, QueryMalformedException, UserNotFoundException;
 
     /**
      * Insert data from a csv into a table of a table-database id tuple, we need the "root" role for this as the
@@ -290,11 +268,10 @@ public interface QueryService {
      * @throws TableMalformedException    The table does not exist in the metadata database.
      * @throws DatabaseNotFoundException  The database is not found in the metadata database.
      * @throws TableNotFoundException     The table is not found in the metadata database.
-     * @throws ContainerNotFoundException The container was not found in the metadata database.
      * @throws QueryMalformedException    The query is malformed.
      */
-    void insert(Long containerId, Long databaseId, Long tableId, ImportDto data, Principal principal) throws ImageNotSupportedException,
-            TableMalformedException, DatabaseNotFoundException, TableNotFoundException, ContainerNotFoundException, DatabaseConnectionException, QueryMalformedException, UserNotFoundException;
+    void insert(Long databaseId, Long tableId, ImportDto data, Principal principal) throws ImageNotSupportedException,
+            TableMalformedException, DatabaseNotFoundException, TableNotFoundException, DatabaseConnectionException, QueryMalformedException, UserNotFoundException;
 
     /**
      * Parses the stored columns from a given query.
diff --git a/dbrepo-query-service/services/src/main/java/at/tuwien/service/StoreService.java b/dbrepo-query-service/services/src/main/java/at/tuwien/service/StoreService.java
index 1df5336c91..78729069ff 100644
--- a/dbrepo-query-service/services/src/main/java/at/tuwien/service/StoreService.java
+++ b/dbrepo-query-service/services/src/main/java/at/tuwien/service/StoreService.java
@@ -1,15 +1,11 @@
 package at.tuwien.service;
 
 import at.tuwien.api.database.query.ExecuteStatementDto;
-import at.tuwien.api.database.query.QueryResultDto;
-import at.tuwien.api.database.query.QueryTypeDto;
 import at.tuwien.exception.*;
 import at.tuwien.querystore.Query;
 import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
 
 import java.security.Principal;
-import java.time.Instant;
 import java.util.List;
 
 @Service
@@ -26,7 +22,7 @@ public interface StoreService {
      * @throws DatabaseNotFoundException  The database was not found in the metadata database
      * @throws QueryStoreException        The query store produced an invalid result
      */
-    List<Query> findAll(Long containerId, Long databaseId, Boolean persisted, Principal principal) throws DatabaseNotFoundException,
+    List<Query> findAll(Long databaseId, Boolean persisted, Principal principal) throws DatabaseNotFoundException,
             ImageNotSupportedException, QueryStoreException, ContainerNotFoundException, DatabaseConnectionException,
             TableMalformedException, UserNotFoundException;
 
@@ -42,13 +38,12 @@ public interface StoreService {
      * @throws QueryStoreException        The query store produced an invalid result
      * @throws QueryNotFoundException     The query store did not return a query
      */
-    Query findOne(Long containerId, Long databaseId, Long queryId, Principal principal) throws DatabaseNotFoundException,
+    Query findOne(Long databaseId, Long queryId, Principal principal) throws DatabaseNotFoundException,
             ImageNotSupportedException, DatabaseConnectionException, QueryNotFoundException, QueryStoreException, UserNotFoundException;
 
     /**
      * Inserts a query and metadata to the query store of a given database id
      *
-     * @param containerId The container id.
      * @param databaseId  The database id.
      * @param metadata    The statement.
      * @param principal   The user principal.
@@ -56,18 +51,15 @@ public interface StoreService {
      * @throws QueryStoreException         The query store raised some error
      * @throws DatabaseNotFoundException   The database id was not found in the metadata database
      * @throws ImageNotSupportedException  The image is not supported
-     * @throws ContainerNotFoundException  The container was not found in the metadata database.
      * @throws UserNotFoundException       The user was not found in the metadata database.
      * @throws DatabaseConnectionException The database connection to the remote container failed.
      */
-    Query insert(Long containerId, Long databaseId, ExecuteStatementDto metadata, Principal principal) throws QueryStoreException,
-            DatabaseNotFoundException, ImageNotSupportedException, ContainerNotFoundException, UserNotFoundException,
-            DatabaseConnectionException;
+    Query insert(Long databaseId, ExecuteStatementDto metadata, Principal principal) throws QueryStoreException,
+            DatabaseNotFoundException, ImageNotSupportedException, UserNotFoundException, DatabaseConnectionException;
 
     /**
      * Persists a query to be displayed in the frontend
      *
-     * @param containerId The container id.
      * @param databaseId  The database id.
      * @param queryId     The query id.
      * @param principal   The user principal.
@@ -77,7 +69,7 @@ public interface StoreService {
      * @throws DatabaseConnectionException The database connection to the remote container failed.
      * @throws QueryStoreException         The query store raised some error.
      */
-    Query persist(Long containerId, Long databaseId, Long queryId, Principal principal) throws DatabaseNotFoundException,
+    Query persist(Long databaseId, Long queryId, Principal principal) throws DatabaseNotFoundException,
             ImageNotSupportedException, DatabaseConnectionException, QueryStoreException, UserNotFoundException;
 
     /**
diff --git a/dbrepo-query-service/services/src/main/java/at/tuwien/service/TableService.java b/dbrepo-query-service/services/src/main/java/at/tuwien/service/TableService.java
index a6d4ff28b9..699260696e 100644
--- a/dbrepo-query-service/services/src/main/java/at/tuwien/service/TableService.java
+++ b/dbrepo-query-service/services/src/main/java/at/tuwien/service/TableService.java
@@ -3,7 +3,6 @@ package at.tuwien.service;
 import at.tuwien.api.database.table.TableHistoryDto;
 import at.tuwien.entities.database.table.Table;
 import at.tuwien.exception.*;
-import org.springframework.transaction.annotation.Transactional;
 
 import java.security.Principal;
 import java.util.List;
@@ -13,14 +12,13 @@ public interface TableService {
     /**
      * Find a table in the metadata database by database-table id tuple
      *
-     * @param containerId The container id.
      * @param databaseId  The database id.
      * @param tableId     The table id.
      * @return The database.
      * @throws DatabaseNotFoundException The database is not found.
      * @throws TableNotFoundException    The table is not found.
      */
-    Table find(Long containerId, Long databaseId, Long tableId) throws DatabaseNotFoundException, TableNotFoundException;
+    Table find(Long databaseId, Long tableId) throws DatabaseNotFoundException, TableNotFoundException;
 
     /**
      * Finds all tables in the metdata database.
@@ -32,7 +30,6 @@ public interface TableService {
     /**
      * Find the table history.
      *
-     * @param containerId The container id.
      * @param databaseId  The database id.
      * @param tableId     The table id.
      * @param principal   The user principal.
@@ -41,6 +38,6 @@ public interface TableService {
      * @throws DatabaseNotFoundException The database is not found.
      * @throws TableNotFoundException    The table is not found.
      */
-    List<TableHistoryDto> findHistory(Long containerId, Long databaseId, Long tableId, Principal principal)
+    List<TableHistoryDto> findHistory(Long databaseId, Long tableId, Principal principal)
             throws DatabaseNotFoundException, QueryMalformedException, TableNotFoundException, DatabaseConnectionException, QueryStoreException, UserNotFoundException;
 }
diff --git a/dbrepo-query-service/services/src/main/java/at/tuwien/service/ViewService.java b/dbrepo-query-service/services/src/main/java/at/tuwien/service/ViewService.java
index e5d1882608..be7e631bdf 100644
--- a/dbrepo-query-service/services/src/main/java/at/tuwien/service/ViewService.java
+++ b/dbrepo-query-service/services/src/main/java/at/tuwien/service/ViewService.java
@@ -34,7 +34,6 @@ public interface ViewService {
     /**
      * Delete view in the container with the given id and database with id and the given view id.
      *
-     * @param containerId The container id.
      * @param databaseId  The database id.
      * @param id          The view id.
      * @param principal   The authorization principal.
@@ -45,13 +44,12 @@ public interface ViewService {
      * @throws QueryMalformedException     The query to delete the view is malformed.
      * @throws ViewMalformedException      The view is malformed and could not be deleted.
      */
-    void delete(Long containerId, Long databaseId, Long id, Principal principal) throws ViewNotFoundException,
+    void delete(Long databaseId, Long id, Principal principal) throws ViewNotFoundException,
             UserNotFoundException, DatabaseNotFoundException, DatabaseConnectionException, QueryMalformedException, ViewMalformedException;
 
     /**
      * Creates a view in the container with given id and database with id with the given query.
      *
-     * @param containerId The container id.
      * @param databaseId  The database id.
      * @param data        The given query.
      * @param principal   The authorization principal.
@@ -62,6 +60,6 @@ public interface ViewService {
      * @throws ViewMalformedException      The view is malformed and could not be created.
      * @throws UserNotFoundException       The user with authorization principal was not found.
      */
-    View create(Long containerId, Long databaseId, ViewCreateDto data, Principal principal) throws DatabaseNotFoundException,
+    View create(Long databaseId, ViewCreateDto data, Principal principal) throws DatabaseNotFoundException,
             DatabaseConnectionException, QueryMalformedException, ViewMalformedException, UserNotFoundException;
 }
diff --git a/dbrepo-query-service/services/src/main/java/at/tuwien/service/impl/DatabaseServiceImpl.java b/dbrepo-query-service/services/src/main/java/at/tuwien/service/impl/DatabaseServiceImpl.java
index 4a2a8927f7..80d6ce2c64 100644
--- a/dbrepo-query-service/services/src/main/java/at/tuwien/service/impl/DatabaseServiceImpl.java
+++ b/dbrepo-query-service/services/src/main/java/at/tuwien/service/impl/DatabaseServiceImpl.java
@@ -25,10 +25,10 @@ public class DatabaseServiceImpl implements DatabaseService {
 
     @Override
     @Transactional(readOnly = true)
-    public Database find(Long containerId, Long databaseId) throws DatabaseNotFoundException {
-        final Optional<Database> database = databaseRepository.findByContainerIdAndDatabaseId(containerId, databaseId);
+    public Database find(Long databaseId) throws DatabaseNotFoundException {
+        final Optional<Database> database = databaseRepository.findByDatabaseId(databaseId);
         if (database.isEmpty()) {
-            log.error("Failed to find database with container id {} and database id {}", containerId, databaseId);
+            log.error("Failed to find database with database id {}", databaseId);
             throw new DatabaseNotFoundException("Failed to find database");
         }
         return database.get();
diff --git a/dbrepo-query-service/services/src/main/java/at/tuwien/service/impl/HibernateConnector.java b/dbrepo-query-service/services/src/main/java/at/tuwien/service/impl/HibernateConnector.java
index 1ed1d00e1a..f17bbadccd 100644
--- a/dbrepo-query-service/services/src/main/java/at/tuwien/service/impl/HibernateConnector.java
+++ b/dbrepo-query-service/services/src/main/java/at/tuwien/service/impl/HibernateConnector.java
@@ -2,31 +2,21 @@ package at.tuwien.service.impl;
 
 import at.tuwien.entities.container.Container;
 import at.tuwien.entities.container.image.ContainerImage;
-import at.tuwien.entities.container.image.ContainerImageEnvironmentItem;
-import at.tuwien.entities.container.image.ContainerImageEnvironmentItemType;
 import at.tuwien.entities.database.Database;
-import at.tuwien.entities.user.User;
-import at.tuwien.exception.DatabaseConnectionException;
 import com.mchange.v2.c3p0.ComboPooledDataSource;
 import lombok.extern.log4j.Log4j2;
 import org.springframework.stereotype.Service;
 
-import java.security.Principal;
-import java.sql.Connection;
-import java.sql.SQLException;
-import java.util.stream.Collectors;
-
 @Log4j2
 @Service
 public abstract class HibernateConnector {
 
-    protected static ComboPooledDataSource getDataSource(ContainerImage image, Container container, Database database,
-                                                         User user) {
+    protected static ComboPooledDataSource getPrivilegedDataSource(ContainerImage image, Container container, Database database) {
         final ComboPooledDataSource dataSource = new ComboPooledDataSource();
-        final String url = "jdbc:" + image.getJdbcMethod() + "://" + container.getInternalName() + "/" + (database != null ? database.getInternalName() : "");
+        final String url = "jdbc:" + image.getJdbcMethod() + "://" + container.getHost() + ":" + container.getPort() + "/" + (database != null ? database.getInternalName() : "");
         dataSource.setJdbcUrl(url);
-        dataSource.setUser(user.getUsername());
-        dataSource.setPassword(user.getDatabasePassword());
+        dataSource.setUser(container.getPrivilegedUsername());
+        dataSource.setPassword(container.getPrivilegedPassword());
         dataSource.setInitialPoolSize(5);
         dataSource.setMinPoolSize(5);
         dataSource.setAcquireIncrement(5);
@@ -35,5 +25,4 @@ public abstract class HibernateConnector {
         log.trace("created pooled data source {}", dataSource);
         return dataSource;
     }
-
 }
diff --git a/dbrepo-query-service/services/src/main/java/at/tuwien/service/impl/QueryServiceImpl.java b/dbrepo-query-service/services/src/main/java/at/tuwien/service/impl/QueryServiceImpl.java
index b230ecadb5..386a2cf574 100644
--- a/dbrepo-query-service/services/src/main/java/at/tuwien/service/impl/QueryServiceImpl.java
+++ b/dbrepo-query-service/services/src/main/java/at/tuwien/service/impl/QueryServiceImpl.java
@@ -12,12 +12,13 @@ import at.tuwien.entities.database.Database;
 import at.tuwien.entities.database.View;
 import at.tuwien.entities.database.table.Table;
 import at.tuwien.entities.database.table.columns.TableColumn;
-import at.tuwien.entities.user.User;
 import at.tuwien.exception.*;
-import at.tuwien.mapper.DatabaseMapper;
 import at.tuwien.mapper.QueryMapper;
 import at.tuwien.querystore.Query;
-import at.tuwien.service.*;
+import at.tuwien.service.DatabaseService;
+import at.tuwien.service.QueryService;
+import at.tuwien.service.StoreService;
+import at.tuwien.service.TableService;
 import com.mchange.v2.c3p0.ComboPooledDataSource;
 import lombok.extern.log4j.Log4j2;
 import net.sf.jsqlparser.JSQLParserException;
@@ -54,43 +55,41 @@ public class QueryServiceImpl extends HibernateConnector implements QueryService
     private final QueryMapper queryMapper;
     private final TableService tableService;
     private final StoreService storeService;
-    private final DatabaseMapper databaseMapper;
     private final DatabaseService databaseService;
 
     @Autowired
     public QueryServiceImpl(QueryMapper queryMapper, TableService tableService,
-                            DatabaseService databaseService, StoreService storeService, DatabaseMapper databaseMapper) {
+                            DatabaseService databaseService, StoreService storeService) {
         this.queryMapper = queryMapper;
         this.tableService = tableService;
         this.storeService = storeService;
-        this.databaseMapper = databaseMapper;
         this.databaseService = databaseService;
     }
 
     @Override
     @Transactional(readOnly = true)
-    public QueryResultDto execute(Long containerId, Long databaseId, ExecuteStatementDto statement,
+    public QueryResultDto execute(Long databaseId, ExecuteStatementDto statement,
                                   Principal principal, Long page, Long size, SortType sortDirection, String sortColumn)
             throws DatabaseNotFoundException, ImageNotSupportedException, QueryMalformedException, QueryStoreException,
-            ContainerNotFoundException, ColumnParseException, UserNotFoundException, DatabaseConnectionException,
+            ColumnParseException, UserNotFoundException, DatabaseConnectionException,
             TableMalformedException {
         if (statement.getStatement().contains(";")) {
             log.error("Failed to execute query since it contains ';'");
             throw new QueryMalformedException("Failed to execute query since it contains ';'");
         }
-        final Query query = storeService.insert(containerId, databaseId, statement, principal);
-        return reExecute(containerId, databaseId, query, page, size, sortDirection, sortColumn, principal);
+        final Query query = storeService.insert(databaseId, statement, principal);
+        return reExecute(databaseId, query, page, size, sortDirection, sortColumn, principal);
     }
 
     @Override
     @Transactional(readOnly = true)
-    public QueryResultDto reExecute(Long containerId, Long databaseId, Query query, Long page, Long size,
+    public QueryResultDto reExecute(Long databaseId, Query query, Long page, Long size,
                                     SortType sortDirection, String sortColumn, Principal principal)
             throws QueryMalformedException, DatabaseNotFoundException, ImageNotSupportedException, ColumnParseException,
             TableMalformedException {
         /* find */
-        final Database database = databaseService.find(containerId, databaseId);
-        if (!database.getContainer().getImage().getRepository().equals("mariadb")) {
+        final Database database = databaseService.find(databaseId);
+        if (!database.getContainer().getImage().getName().equals("mariadb")) {
             throw new ImageNotSupportedException("Currently only MariaDB is supported");
         }
         /* map the result to the tables (with respective columns) from the statement metadata */
@@ -102,7 +101,7 @@ public class QueryServiceImpl extends HibernateConnector implements QueryService
             throw new ColumnParseException("Failed to map/parse columns: " + e.getMessage(), e);
         }
         final String statement = queryMapper.queryToRawTimestampedQuery(query.getQuery(), database, query.getCreated(), true, page, size);
-        final QueryResultDto dto = executeNonPersistent(containerId, databaseId, statement, columns);
+        final QueryResultDto dto = executeNonPersistent(databaseId, statement, columns);
         dto.setId(query.getId());
         dto.setResultNumber(query.getResultNumber());
         return dto;
@@ -110,12 +109,12 @@ public class QueryServiceImpl extends HibernateConnector implements QueryService
 
     @Override
     @Transactional(readOnly = true)
-    public Long reExecuteCount(Long containerId, Long databaseId, Query query, Principal principal)
+    public Long reExecuteCount(Long databaseId, Query query, Principal principal)
             throws QueryMalformedException, DatabaseNotFoundException, ImageNotSupportedException, ColumnParseException,
             TableMalformedException, QueryStoreException {
         /* find */
-        final Database database = databaseService.find(containerId, databaseId);
-        if (!database.getContainer().getImage().getRepository().equals("mariadb")) {
+        final Database database = databaseService.find(databaseId);
+        if (!database.getContainer().getImage().getName().equals("mariadb")) {
             throw new ImageNotSupportedException("Currently only MariaDB is supported");
         }
         /* run query */
@@ -126,7 +125,7 @@ public class QueryServiceImpl extends HibernateConnector implements QueryService
             throw new ColumnParseException("Failed to map/parse columns: " + e.getMessage(), e);
         }
         final String statement = queryMapper.queryToRawTimestampedQuery(query.getQuery(), database, query.getCreated(), false, null, null);
-        return executeCountNonPersistent(containerId, databaseId, statement);
+        return executeCountNonPersistent(databaseId, statement);
     }
 
     private PreparedStatement prepareStatement(Connection connection, String statement) throws QueryMalformedException {
@@ -138,14 +137,13 @@ public class QueryServiceImpl extends HibernateConnector implements QueryService
         }
     }
 
-    private QueryResultDto executeNonPersistent(Long containerId, Long databaseId, String statement, List<TableColumn> columns)
+    private QueryResultDto executeNonPersistent(Long databaseId, String statement, List<TableColumn> columns)
             throws QueryMalformedException, DatabaseNotFoundException, TableMalformedException {
         /* find */
-        final Database database = databaseService.find(containerId, databaseId);
-        final User root = databaseMapper.containerToPrivilegedUser(database.getContainer());
+        final Database database = databaseService.find(databaseId);
         /* run query */
-        final ComboPooledDataSource dataSource = getDataSource(database.getContainer().getImage(),
-                database.getContainer(), database, root);
+        final ComboPooledDataSource dataSource = getPrivilegedDataSource(database.getContainer().getImage(),
+                database.getContainer(), database);
         try {
             final Connection connection = dataSource.getConnection();
             final PreparedStatement preparedStatement = prepareStatement(connection, statement);
@@ -159,14 +157,13 @@ public class QueryServiceImpl extends HibernateConnector implements QueryService
         }
     }
 
-    private Long executeCountNonPersistent(Long containerId, Long databaseId, String statement)
+    private Long executeCountNonPersistent(Long databaseId, String statement)
             throws QueryMalformedException, TableMalformedException, DatabaseNotFoundException, QueryStoreException {
         /* find */
-        final Database database = databaseService.find(containerId, databaseId);
-        final User root = databaseMapper.containerToPrivilegedUser(database.getContainer());
+        final Database database = databaseService.find(databaseId);
         /* run query */
-        final ComboPooledDataSource dataSource = getDataSource(database.getContainer().getImage(),
-                database.getContainer(), database, root);
+        final ComboPooledDataSource dataSource = getPrivilegedDataSource(database.getContainer().getImage(),
+                database.getContainer(), database);
         try {
             final Connection connection = dataSource.getConnection();
             final PreparedStatement preparedStatement = prepareStatement(connection, statement);
@@ -182,71 +179,70 @@ public class QueryServiceImpl extends HibernateConnector implements QueryService
 
     @Override
     @Transactional(readOnly = true)
-    public QueryResultDto tableFindAll(Long containerId, Long databaseId, Long tableId, Instant timestamp, Long page,
+    public QueryResultDto tableFindAll(Long databaseId, Long tableId, Instant timestamp, Long page,
                                        Long size, Principal principal) throws TableNotFoundException, DatabaseNotFoundException,
             ImageNotSupportedException, TableMalformedException, QueryMalformedException {
         /* find */
-        final Table table = tableService.find(containerId, databaseId, tableId);
+        final Table table = tableService.find(databaseId, tableId);
         /* run query */
         String statement = queryMapper.tableToRawFindAllQuery(table, timestamp, size, page);
-        return executeNonPersistent(containerId, databaseId, statement, table.getColumns());
+        return executeNonPersistent(databaseId, statement, table.getColumns());
     }
 
     @Override
     @Transactional(readOnly = true)
-    public QueryResultDto viewFindAll(Long containerId, Long databaseId, View view,
+    public QueryResultDto viewFindAll(Long databaseId, View view,
                                       Long page, Long size, Principal principal) throws DatabaseNotFoundException,
             ImageNotSupportedException, QueryMalformedException, TableMalformedException {
         /* find */
         /* run query */
         String statement = queryMapper.viewToRawFindAllQuery(view, size, page);
-        return executeNonPersistent(containerId, databaseId, statement, view.getColumns());
+        return executeNonPersistent(databaseId, statement, view.getColumns());
     }
 
     @Override
     @Transactional
-    public Long tableCount(Long containerId, Long databaseId, Long tableId, Instant timestamp, Principal principal)
+    public Long tableCount(Long databaseId, Long tableId, Instant timestamp, Principal principal)
             throws DatabaseNotFoundException, TableNotFoundException, ImageNotSupportedException,
             QueryMalformedException, QueryStoreException, TableMalformedException {
         /* find */
-        final Table table = tableService.find(containerId, databaseId, tableId);
+        final Table table = tableService.find(databaseId, tableId);
         final String statement = queryMapper.tableToRawCountAllQuery(table, timestamp);
-        return executeCountNonPersistent(containerId, databaseId, statement);
+        return executeCountNonPersistent(databaseId, statement);
     }
 
     @Override
     @Transactional
-    public Long viewCount(Long containerId, Long databaseId, View view, Principal principal)
+    public Long viewCount(Long databaseId, View view, Principal principal)
             throws DatabaseNotFoundException, ImageNotSupportedException,
             QueryMalformedException, QueryStoreException, TableMalformedException {
         /* find */
         final String statement = queryMapper.viewToRawCountAllQuery(view);
-        return executeCountNonPersistent(containerId, databaseId, statement);
+        return executeCountNonPersistent(databaseId, statement);
     }
 
     @Transactional(readOnly = true)
-    public QueryResultDto findAllView(Long containerId, Long databaseId, Long viewId, Instant timestamp, Long page,
+    public QueryResultDto findAllView(Long databaseId, Long viewId, Instant timestamp, Long page,
                                       Long size, Principal principal) throws TableNotFoundException, DatabaseNotFoundException,
             ImageNotSupportedException, TableMalformedException, QueryMalformedException {
         /* find */
-        final Table table = tableService.find(containerId, databaseId, viewId);
+        final Table table = tableService.find(databaseId, viewId);
         /* run query */
         String statement = queryMapper.tableToRawFindAllQuery(table, timestamp, size, page);
-        return executeNonPersistent(containerId, databaseId, statement, table.getColumns());
+        return executeNonPersistent(databaseId, statement, table.getColumns());
     }
 
     @Override
     @Transactional(readOnly = true)
-    public ExportResource tableFindAll(Long containerId, Long databaseId, Long tableId, Instant timestamp, Principal principal)
+    public ExportResource tableFindAll(Long databaseId, Long tableId, Instant timestamp, Principal principal)
             throws TableNotFoundException, DatabaseNotFoundException, FileStorageException, QueryMalformedException {
         final String filename = RandomStringUtils.randomAlphabetic(40) + ".csv";
         /* find */
-        final Database database = databaseService.find(containerId, databaseId);
-        final Table table = tableService.find(containerId, databaseId, tableId);
-        final User root = databaseMapper.containerToPrivilegedUser(database.getContainer());
+        final Database database = databaseService.find(databaseId);
+        final Table table = tableService.find(databaseId, tableId);
         /* run query */
-        final ComboPooledDataSource dataSource = getDataSource(database.getContainer().getImage(),
-                database.getContainer(), database, root);
+        final ComboPooledDataSource dataSource = getPrivilegedDataSource(database.getContainer().getImage(),
+                database.getContainer(), database);
         /* read file */
         final InputStreamResource resource;
         try {
@@ -270,17 +266,16 @@ public class QueryServiceImpl extends HibernateConnector implements QueryService
 
     @Override
     @Transactional(readOnly = true)
-    public ExportResource findOne(Long containerId, Long databaseId, Long queryId, Principal principal)
+    public ExportResource findOne(Long databaseId, Long queryId, Principal principal)
             throws DatabaseNotFoundException, ImageNotSupportedException, FileStorageException, QueryStoreException,
             QueryNotFoundException, QueryMalformedException, DatabaseConnectionException, UserNotFoundException {
         final String filename = RandomStringUtils.randomAlphabetic(40) + ".csv";
         /* find */
-        final Database database = databaseService.find(containerId, databaseId);
-        final Query query = storeService.findOne(containerId, databaseId, queryId, principal);
-        final User root = databaseMapper.containerToPrivilegedUser(database.getContainer());
+        final Database database = databaseService.find(databaseId);
+        final Query query = storeService.findOne(databaseId, queryId, principal);
         /* run query */
-        final ComboPooledDataSource dataSource = getDataSource(database.getContainer().getImage(),
-                database.getContainer(), database, root);
+        final ComboPooledDataSource dataSource = getPrivilegedDataSource(database.getContainer().getImage(),
+                database.getContainer(), database);
         /* read file */
         final InputStreamResource resource;
         try {
@@ -309,17 +304,16 @@ public class QueryServiceImpl extends HibernateConnector implements QueryService
 
     @Override
     @Transactional
-    public void update(Long containerId, Long databaseId, Long tableId, TableCsvUpdateDto data, Principal principal)
+    public void update(Long databaseId, Long tableId, TableCsvUpdateDto data, Principal principal)
             throws ImageNotSupportedException, TableMalformedException, DatabaseNotFoundException,
             TableNotFoundException, QueryMalformedException {
         /* find */
-        final Database database = databaseService.find(containerId, databaseId);
-        final Table table = tableService.find(containerId, databaseId, tableId);
-        final User root = databaseMapper.containerToPrivilegedUser(database.getContainer());
+        final Database database = databaseService.find(databaseId);
+        final Table table = tableService.find(databaseId, tableId);
         /* run query */
         if (data.getData().size() == 0 || data.getKeys().size() == 0) return;
-        final ComboPooledDataSource dataSource = getDataSource(database.getContainer().getImage(),
-                database.getContainer(), database, root);
+        final ComboPooledDataSource dataSource = getPrivilegedDataSource(database.getContainer().getImage(),
+                database.getContainer(), database);
         try {
             final Connection connection = dataSource.getConnection();
             final PreparedStatement preparedStatement = queryMapper.tableCsvDtoToRawUpdateQuery(connection, table, data);
@@ -334,17 +328,15 @@ public class QueryServiceImpl extends HibernateConnector implements QueryService
 
     @Override
     @Transactional
-    public void insert(Long containerId, Long databaseId, Long tableId, TableCsvDto data, Principal principal)
-            throws ImageNotSupportedException, TableMalformedException, DatabaseNotFoundException,
-            TableNotFoundException, ContainerNotFoundException, DatabaseConnectionException, UserNotFoundException {
+    public void insert(Long databaseId, Long tableId, TableCsvDto data, Principal principal)
+            throws TableMalformedException, DatabaseNotFoundException, TableNotFoundException {
         /* find */
-        final Database database = databaseService.find(containerId, databaseId);
-        final Table table = tableService.find(containerId, databaseId, tableId);
-        final User root = databaseMapper.containerToPrivilegedUser(database.getContainer());
+        final Database database = databaseService.find(databaseId);
+        final Table table = tableService.find(databaseId, tableId);
         log.trace("parsed insert data {}", data);
         /* run query */
-        final ComboPooledDataSource dataSource = getDataSource(database.getContainer().getImage(),
-                database.getContainer(), database, root);
+        final ComboPooledDataSource dataSource = getPrivilegedDataSource(database.getContainer().getImage(),
+                database.getContainer(), database);
         /* prepare the statement */
         try {
             final Connection connection = dataSource.getConnection();
@@ -366,17 +358,16 @@ public class QueryServiceImpl extends HibernateConnector implements QueryService
 
     @Override
     @Transactional
-    public void delete(Long containerId, Long databaseId, Long tableId, TableCsvDeleteDto data, Principal principal)
+    public void delete(Long databaseId, Long tableId, TableCsvDeleteDto data, Principal principal)
             throws ImageNotSupportedException, TableMalformedException, DatabaseNotFoundException,
             TableNotFoundException, DatabaseConnectionException, QueryMalformedException, UserNotFoundException {
         /* find */
-        final Database database = databaseService.find(containerId, databaseId);
-        final Table table = tableService.find(containerId, databaseId, tableId);
-        final User root = databaseMapper.containerToPrivilegedUser(database.getContainer());
+        final Database database = databaseService.find(databaseId);
+        final Table table = tableService.find(databaseId, tableId);
         /* run query */
         if (data.getKeys().size() == 0) return;
-        final ComboPooledDataSource dataSource = getDataSource(database.getContainer().getImage(),
-                database.getContainer(), database, root);
+        final ComboPooledDataSource dataSource = getPrivilegedDataSource(database.getContainer().getImage(),
+                database.getContainer(), database);
         /* prepare the statement */
         try {
             final Connection connection = dataSource.getConnection();
@@ -392,17 +383,14 @@ public class QueryServiceImpl extends HibernateConnector implements QueryService
 
     @Override
     @Transactional
-    public void insert(Long containerId, Long databaseId, Long tableId, ImportDto data, Principal principal)
-            throws ImageNotSupportedException, TableMalformedException, DatabaseNotFoundException,
-            TableNotFoundException, ContainerNotFoundException, DatabaseConnectionException, QueryMalformedException,
-            UserNotFoundException {
+    public void insert(Long databaseId, Long tableId, ImportDto data, Principal principal)
+            throws TableMalformedException, DatabaseNotFoundException, TableNotFoundException, QueryMalformedException {
         /* find */
-        final Database database = databaseService.find(containerId, databaseId);
-        final Table table = tableService.find(containerId, databaseId, tableId);
-        final User root = databaseMapper.containerToPrivilegedUser(database.getContainer());
+        final Database database = databaseService.find(databaseId);
+        final Table table = tableService.find(databaseId, tableId);
         /* preparing the statements */
-        final ComboPooledDataSource dataSource = getDataSource(database.getContainer().getImage(),
-                database.getContainer(), database, root);
+        final ComboPooledDataSource dataSource = getPrivilegedDataSource(database.getContainer().getImage(),
+                database.getContainer(), database);
         /* Create a temporary table, insert there, transfer with update on duplicate key and lastly drops the temporary table */
         try {
             final Connection connection = dataSource.getConnection();
diff --git a/dbrepo-query-service/services/src/main/java/at/tuwien/service/impl/RabbitMqServiceImpl.java b/dbrepo-query-service/services/src/main/java/at/tuwien/service/impl/RabbitMqServiceImpl.java
index e814476f1d..f6f3b647f8 100644
--- a/dbrepo-query-service/services/src/main/java/at/tuwien/service/impl/RabbitMqServiceImpl.java
+++ b/dbrepo-query-service/services/src/main/java/at/tuwien/service/impl/RabbitMqServiceImpl.java
@@ -4,13 +4,14 @@ import at.tuwien.amqp.RabbitMqConsumer;
 import at.tuwien.api.amqp.ConsumerDto;
 import at.tuwien.config.AmqpConfig;
 import at.tuwien.entities.database.table.Table;
-import at.tuwien.exception.*;
+import at.tuwien.exception.AmqpException;
 import at.tuwien.gateway.BrokerServiceGateway;
 import at.tuwien.service.MessageQueueService;
 import at.tuwien.service.QueryService;
 import at.tuwien.service.TableService;
 import com.fasterxml.jackson.databind.ObjectMapper;
-import com.rabbitmq.client.*;
+import com.rabbitmq.client.Channel;
+import com.rabbitmq.client.Connection;
 import lombok.extern.log4j.Log4j2;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -42,7 +43,7 @@ public class RabbitMqServiceImpl implements MessageQueueService {
     }
 
     @Override
-    public void createConsumer(String queueName, Long containerId, Long databaseId, Long tableId) throws AmqpException {
+    public void createConsumer(String queueName, Long databaseId, Long tableId) throws AmqpException {
         try {
             if (!this.channel.isOpen()) {
                 log.warn("Channel with id {} is closed", this.channel.getChannelNumber());
@@ -50,8 +51,7 @@ public class RabbitMqServiceImpl implements MessageQueueService {
                 this.channel = tmp.createChannel();
                 log.info("Opened channel with id {}", this.channel.getChannelNumber());
             }
-            final String consumerTag = this.channel.basicConsume(queueName, true, new RabbitMqConsumer(containerId,
-                    databaseId, tableId, objectMapper, queryService));
+            final String consumerTag = this.channel.basicConsume(queueName, true, new RabbitMqConsumer(databaseId, tableId, objectMapper, queryService));
             log.debug("declared consumer for queue name {} with tag {}", queueName, consumerTag);
         } catch (IOException e) {
             log.error("Failed to create consumer for table with id {}, reason: {}", tableId, e.getMessage());
@@ -72,8 +72,7 @@ public class RabbitMqServiceImpl implements MessageQueueService {
                 continue;
             }
             for (long i = consumerCount; i < amqpConfig.getAmqpConsumers(); i++) {
-                createConsumer(table.getQueueName(), table.getDatabase().getContainer().getId(),
-                        table.getDatabase().getId(), table.getId());
+                createConsumer(table.getQueueName(), table.getDatabase().getId(), table.getId());
             }
         }
     }
diff --git a/dbrepo-query-service/services/src/main/java/at/tuwien/service/impl/StoreServiceImpl.java b/dbrepo-query-service/services/src/main/java/at/tuwien/service/impl/StoreServiceImpl.java
index 4bfb01e9d4..bacc9cff59 100644
--- a/dbrepo-query-service/services/src/main/java/at/tuwien/service/impl/StoreServiceImpl.java
+++ b/dbrepo-query-service/services/src/main/java/at/tuwien/service/impl/StoreServiceImpl.java
@@ -1,10 +1,9 @@
 package at.tuwien.service.impl;
 
 import at.tuwien.api.database.query.ExecuteStatementDto;
-import at.tuwien.entities.user.User;
 import at.tuwien.entities.database.Database;
+import at.tuwien.entities.user.User;
 import at.tuwien.exception.*;
-import at.tuwien.mapper.DatabaseMapper;
 import at.tuwien.mapper.StoreMapper;
 import at.tuwien.querystore.Query;
 import at.tuwien.service.DatabaseService;
@@ -27,33 +26,29 @@ public class StoreServiceImpl extends HibernateConnector implements StoreService
 
     private final StoreMapper storeMapper;
     private final UserService userService;
-    private final DatabaseMapper databaseMapper;
     private final DatabaseService databaseService;
 
     @Autowired
-    public StoreServiceImpl(StoreMapper storeMapper, UserService userService, DatabaseMapper databaseMapper,
-                            DatabaseService databaseService) {
+    public StoreServiceImpl(StoreMapper storeMapper, UserService userService, DatabaseService databaseService) {
         this.storeMapper = storeMapper;
         this.userService = userService;
-        this.databaseMapper = databaseMapper;
         this.databaseService = databaseService;
     }
 
     @Override
     @Transactional(readOnly = true)
-    public List<Query> findAll(Long containerId, Long databaseId, Boolean persisted, Principal principal)
+    public List<Query> findAll(Long databaseId, Boolean persisted, Principal principal)
             throws DatabaseNotFoundException, ImageNotSupportedException, QueryStoreException,
             ContainerNotFoundException, DatabaseConnectionException, TableMalformedException, UserNotFoundException {
         /* find */
-        final Database database = databaseService.find(containerId, databaseId);
-        if (!database.getContainer().getImage().getRepository().equals("mariadb")) {
+        final Database database = databaseService.find(databaseId);
+        if (!database.getContainer().getImage().getName().equals("mariadb")) {
             log.error("Currently only MariaDB is supported");
             throw new ImageNotSupportedException("Currently only MariaDB is supported");
         }
-        final User root = databaseMapper.containerToPrivilegedUser(database.getContainer());
         /* run query */
-        final ComboPooledDataSource dataSource = getDataSource(database.getContainer().getImage(),
-                database.getContainer(), database, root);
+        final ComboPooledDataSource dataSource = getPrivilegedDataSource(database.getContainer().getImage(),
+                database.getContainer(), database);
         /* select all */
         try {
             final Connection connection = dataSource.getConnection();
@@ -61,7 +56,7 @@ public class StoreServiceImpl extends HibernateConnector implements StoreService
             final ResultSet resultSet = preparedStatement.executeQuery();
             return resultSetToQueryList(resultSet);
         } catch (SQLException e) {
-            log.error("Failed to find queries in container with id {} and database with id {}, reason: {}", containerId, databaseId, e.getMessage());
+            log.error("Failed to find queries in container with database with id {}, reason: {}", databaseId, e.getMessage());
             throw new QueryStoreException("Failed to find queries: " + e.getMessage());
         } finally {
             dataSource.close();
@@ -70,17 +65,16 @@ public class StoreServiceImpl extends HibernateConnector implements StoreService
 
     @Override
     @Transactional(readOnly = true)
-    public Query findOne(Long containerId, Long databaseId, Long queryId, Principal principal)
+    public Query findOne(Long databaseId, Long queryId, Principal principal)
             throws DatabaseNotFoundException, ImageNotSupportedException, QueryNotFoundException, QueryStoreException {
         /* find */
-        final Database database = databaseService.find(containerId, databaseId);
-        if (!database.getContainer().getImage().getRepository().equals("mariadb")) {
+        final Database database = databaseService.find(databaseId);
+        if (!database.getContainer().getImage().getName().equals("mariadb")) {
             throw new ImageNotSupportedException("Currently only MariaDB is supported");
         }
-        final User root = databaseMapper.containerToPrivilegedUser(database.getContainer());
         /* run query */
-        final ComboPooledDataSource dataSource = getDataSource(database.getContainer().getImage(),
-                database.getContainer(), database, root);
+        final ComboPooledDataSource dataSource = getPrivilegedDataSource(database.getContainer().getImage(),
+                database.getContainer(), database);
         /* use jpa to select one */
         try {
             final Connection connection = dataSource.getConnection();
@@ -101,18 +95,17 @@ public class StoreServiceImpl extends HibernateConnector implements StoreService
 
     @Override
     @Transactional(readOnly = true)
-    public Query insert(Long containerId, Long databaseId, ExecuteStatementDto metadata, Principal principal)
+    public Query insert(Long databaseId, ExecuteStatementDto metadata, Principal principal)
             throws QueryStoreException, DatabaseNotFoundException, ImageNotSupportedException,
-            ContainerNotFoundException, UserNotFoundException, DatabaseConnectionException {
+            UserNotFoundException, DatabaseConnectionException {
         /* find */
-        final Database database = databaseService.find(containerId, databaseId);
-        if (!database.getContainer().getImage().getRepository().equals("mariadb")) {
+        final Database database = databaseService.find(databaseId);
+        if (!database.getContainer().getImage().getName().equals("mariadb")) {
             log.error("Currently only MariaDB is supported");
             throw new ImageNotSupportedException("Currently only MariaDB is supported");
         }
         log.trace("insert into database id {}, metadata {}", databaseId, metadata);
         /* user */
-        final User root = databaseMapper.containerToPrivilegedUser(database.getContainer());
         final User creator;
         if (principal != null) {
             creator = userService.findByUsername(principal.getName());
@@ -120,8 +113,8 @@ public class StoreServiceImpl extends HibernateConnector implements StoreService
             creator = userService.findByUsername("system");
         }
         /* save */
-        final ComboPooledDataSource dataSource = getDataSource(database.getContainer().getImage(),
-                database.getContainer(), database, root);
+        final ComboPooledDataSource dataSource = getPrivilegedDataSource(database.getContainer().getImage(),
+                database.getContainer(), database);
         try {
             final Connection connection = dataSource.getConnection();
             final CallableStatement callableStatement = storeMapper.queryStoreRawInsertQuery(connection, creator, metadata);
@@ -148,18 +141,17 @@ public class StoreServiceImpl extends HibernateConnector implements StoreService
 
     @Override
     @Transactional
-    public Query persist(Long containerId, Long databaseId, Long queryId, Principal principal)
-            throws DatabaseNotFoundException, ImageNotSupportedException, QueryStoreException, UserNotFoundException {
+    public Query persist(Long databaseId, Long queryId, Principal principal)
+            throws DatabaseNotFoundException, ImageNotSupportedException, QueryStoreException {
         /* find */
-        final Database database = databaseService.find(containerId, databaseId);
-        if (!database.getContainer().getImage().getRepository().equals("mariadb")) {
+        final Database database = databaseService.find(databaseId);
+        if (!database.getContainer().getImage().getName().equals("mariadb")) {
             log.error("Currently only MariaDB is supported");
             throw new ImageNotSupportedException("Currently only MariaDB is supported");
         }
-        final User root = databaseMapper.containerToPrivilegedUser(database.getContainer());
         /* persist */
-        final ComboPooledDataSource dataSource = getDataSource(database.getContainer().getImage(),
-                database.getContainer(), database, root);
+        final ComboPooledDataSource dataSource = getPrivilegedDataSource(database.getContainer().getImage(),
+                database.getContainer(), database);
         final Query out;
         try {
             final Connection connection = dataSource.getConnection();
@@ -186,14 +178,13 @@ public class StoreServiceImpl extends HibernateConnector implements StoreService
         /* find */
         final List<Database> databases = databaseService.findAll();
         for (Database database : databases) {
-            if (!database.getContainer().getImage().getRepository().equals("mariadb")) {
+            if (!database.getContainer().getImage().getName().equals("mariadb")) {
                 log.error("Currently only MariaDB is supported");
                 throw new ImageNotSupportedException("Currently only MariaDB is supported");
             }
-            final User root = databaseMapper.containerToPrivilegedUser(database.getContainer());
             /* run query */
-            final ComboPooledDataSource dataSource = getDataSource(database.getContainer().getImage(),
-                    database.getContainer(), database, root);
+            final ComboPooledDataSource dataSource = getPrivilegedDataSource(database.getContainer().getImage(),
+                    database.getContainer(), database);
             /* delete stale queries older than 24hrs */
             try {
                 final Connection connection = dataSource.getConnection();
diff --git a/dbrepo-query-service/services/src/main/java/at/tuwien/service/impl/TableServiceImpl.java b/dbrepo-query-service/services/src/main/java/at/tuwien/service/impl/TableServiceImpl.java
index 0ad279d9da..6961541e01 100644
--- a/dbrepo-query-service/services/src/main/java/at/tuwien/service/impl/TableServiceImpl.java
+++ b/dbrepo-query-service/services/src/main/java/at/tuwien/service/impl/TableServiceImpl.java
@@ -3,9 +3,10 @@ package at.tuwien.service.impl;
 import at.tuwien.api.database.table.TableHistoryDto;
 import at.tuwien.entities.database.Database;
 import at.tuwien.entities.database.table.Table;
-import at.tuwien.entities.user.User;
-import at.tuwien.exception.*;
-import at.tuwien.mapper.DatabaseMapper;
+import at.tuwien.exception.DatabaseNotFoundException;
+import at.tuwien.exception.QueryMalformedException;
+import at.tuwien.exception.QueryStoreException;
+import at.tuwien.exception.TableNotFoundException;
 import at.tuwien.mapper.QueryMapper;
 import at.tuwien.repository.mdb.TableRepository;
 import at.tuwien.service.DatabaseService;
@@ -21,31 +22,29 @@ import java.sql.Connection;
 import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.sql.SQLException;
-import java.util.*;
+import java.util.List;
+import java.util.Optional;
 
 @Log4j2
 @Service
 public class TableServiceImpl extends HibernateConnector implements TableService {
 
     private final QueryMapper queryMapper;
-    private final DatabaseMapper databaseMapper;
     private final TableRepository tableRepository;
     private final DatabaseService databaseService;
 
     @Autowired
-    public TableServiceImpl(QueryMapper queryMapper, DatabaseMapper databaseMapper, TableRepository tableRepository,
-                            DatabaseService databaseService) {
+    public TableServiceImpl(QueryMapper queryMapper, TableRepository tableRepository, DatabaseService databaseService) {
         this.queryMapper = queryMapper;
-        this.databaseMapper = databaseMapper;
         this.tableRepository = tableRepository;
         this.databaseService = databaseService;
     }
 
     @Override
     @Transactional(readOnly = true)
-    public Table find(Long containerId, Long databaseId, Long tableId) throws DatabaseNotFoundException,
+    public Table find(Long databaseId, Long tableId) throws DatabaseNotFoundException,
             TableNotFoundException {
-        final Optional<Table> table = tableRepository.find(containerId, databaseId, tableId);
+        final Optional<Table> table = tableRepository.find(databaseId, tableId);
         if (table.isEmpty()) {
             log.error("Failed to find table with id {} in database with id {}", tableId, databaseId);
             throw new TableNotFoundException("Failed to find table");
@@ -61,15 +60,14 @@ public class TableServiceImpl extends HibernateConnector implements TableService
 
     @Override
     @Transactional(readOnly = true)
-    public List<TableHistoryDto> findHistory(Long containerId, Long databaseId, Long tableId, Principal principal)
+    public List<TableHistoryDto> findHistory(Long databaseId, Long tableId, Principal principal)
             throws DatabaseNotFoundException, TableNotFoundException, QueryStoreException, QueryMalformedException {
         /* find */
-        final Database database = databaseService.find(containerId, databaseId);
-        final Table table = find(containerId, databaseId, tableId);
-        final User root = databaseMapper.containerToPrivilegedUser(database.getContainer());
+        final Database database = databaseService.find(databaseId);
+        final Table table = find(databaseId, tableId);
         /* run query */
-        final ComboPooledDataSource dataSource = getDataSource(database.getContainer().getImage(),
-                database.getContainer(), database, root);
+        final ComboPooledDataSource dataSource = getPrivilegedDataSource(database.getContainer().getImage(),
+                database.getContainer(), database);
         /* use jpa to select one */
         try {
             final Connection connection = dataSource.getConnection();
diff --git a/dbrepo-query-service/services/src/main/java/at/tuwien/service/impl/ViewServiceImpl.java b/dbrepo-query-service/services/src/main/java/at/tuwien/service/impl/ViewServiceImpl.java
index e259d39c46..b1605f80db 100644
--- a/dbrepo-query-service/services/src/main/java/at/tuwien/service/impl/ViewServiceImpl.java
+++ b/dbrepo-query-service/services/src/main/java/at/tuwien/service/impl/ViewServiceImpl.java
@@ -6,7 +6,6 @@ import at.tuwien.entities.database.View;
 import at.tuwien.entities.database.table.columns.TableColumn;
 import at.tuwien.entities.user.User;
 import at.tuwien.exception.*;
-import at.tuwien.mapper.DatabaseMapper;
 import at.tuwien.mapper.ViewMapper;
 import at.tuwien.repository.sdb.ViewIdxRepository;
 import at.tuwien.repository.mdb.ViewRepository;
@@ -34,19 +33,16 @@ public class ViewServiceImpl extends HibernateConnector implements ViewService {
 
     private final ViewMapper viewMapper;
     private final UserService userService;
-    private final DatabaseMapper databaseMapper;
     private final ViewRepository viewRepository;
     private final DatabaseService databaseService;
     private final ViewIdxRepository viewIdxRepository;
     private final QueryService queryService;
 
     @Autowired
-    public ViewServiceImpl(ViewMapper viewMapper, UserService userService, DatabaseMapper databaseMapper,
-                           ViewRepository viewRepository, DatabaseService databaseService,
-                           ViewIdxRepository viewIdxRepository, QueryService queryService) {
+    public ViewServiceImpl(ViewMapper viewMapper, UserService userService, ViewRepository viewRepository,
+                           DatabaseService databaseService, ViewIdxRepository viewIdxRepository, QueryService queryService) {
         this.viewMapper = viewMapper;
         this.userService = userService;
-        this.databaseMapper = databaseMapper;
         this.viewRepository = viewRepository;
         this.databaseService = databaseService;
         this.viewIdxRepository = viewIdxRepository;
@@ -84,15 +80,14 @@ public class ViewServiceImpl extends HibernateConnector implements ViewService {
 
     @Override
     @Transactional
-    public void delete(Long containerId, Long databaseId, Long id, Principal principal) throws ViewNotFoundException,
+    public void delete(Long databaseId, Long id, Principal principal) throws ViewNotFoundException,
             UserNotFoundException, DatabaseNotFoundException, DatabaseConnectionException, QueryMalformedException, ViewMalformedException {
         /* find */
         final View view = findById(databaseId, id, principal);
-        final Database database = databaseService.find(containerId, databaseId);
-        final User root = databaseMapper.containerToPrivilegedUser(database.getContainer());
+        final Database database = databaseService.find(databaseId);
         /* delete view */
-        final ComboPooledDataSource dataSource = getDataSource(database.getContainer().getImage(),
-                database.getContainer(), database, root);
+        final ComboPooledDataSource dataSource = getPrivilegedDataSource(database.getContainer().getImage(),
+                database.getContainer(), database);
         try {
             final Connection connection = dataSource.getConnection();
             final PreparedStatement createViewStatement = viewMapper.viewToRawDeleteViewQuery(connection, view);
@@ -112,16 +107,15 @@ public class ViewServiceImpl extends HibernateConnector implements ViewService {
 
     @Override
     @Transactional
-    public View create(Long containerId, Long databaseId, ViewCreateDto data, Principal principal)
+    public View create(Long databaseId, ViewCreateDto data, Principal principal)
             throws DatabaseNotFoundException, DatabaseConnectionException, QueryMalformedException,
             ViewMalformedException, UserNotFoundException {
         /* find */
-        final Database database = databaseService.find(containerId, databaseId);
+        final Database database = databaseService.find(databaseId);
         final User user = userService.findByUsername(principal.getName());
-        final User root = databaseMapper.containerToPrivilegedUser(database.getContainer());
         /* create view */
-        final ComboPooledDataSource dataSource = getDataSource(database.getContainer().getImage(),
-                database.getContainer(), database, root);
+        final ComboPooledDataSource dataSource = getPrivilegedDataSource(database.getContainer().getImage(),
+                database.getContainer(), database);
         final List<TableColumn> columns;
         try {
             columns = queryService.parseColumns(data.getQuery(), database);
@@ -141,7 +135,6 @@ public class ViewServiceImpl extends HibernateConnector implements ViewService {
         }
         /* save in metadata database */
         final View entity = View.builder()
-                .vcid(containerId)
                 .vdbid(databaseId)
                 .name(data.getName())
                 .internalName(viewMapper.nameToInternalName(data.getName()))
diff --git a/dbrepo-query-service/services/src/test/resources/application.properties b/dbrepo-query-service/services/src/test/resources/application.properties
deleted file mode 100644
index b314af67d8..0000000000
--- a/dbrepo-query-service/services/src/test/resources/application.properties
+++ /dev/null
@@ -1,20 +0,0 @@
-# disable discovery
-spring.cloud.discovery.enabled = false
-
-# disable cloud config and config discovery
-spring.cloud.config.discovery.enabled = false
-spring.cloud.config.enabled = false
-
-# disable datasource
-spring.datasource.url=jdbc:h2:mem:testdb
-spring.datasource.driverClassName=org.h2.Driver
-spring.datasource.username=sa
-spring.datasource.password=password
-spring.jpa.database-platform=org.hibernate.dialect.H2Dialect
-spring.jpa.hibernate.ddl-auto=update
-
-# rabbitmq
-spring.rabbitmq.host=dbrepo-broker-service
-spring.rabbitmq.virtual-host=/
-spring.rabbitmq.username=guest
-spring.rabbitmq.password=guest
\ No newline at end of file
-- 
GitLab