@Override
  @SuppressWarnings("nullness")
  public synchronized List<Map<String, Object>> runSQLQuery(String sql) {
    try (Statement stmt = driver.getConnection(getUri(), username, password).createStatement()) {
      List<Map<String, Object>> result = new ArrayList<>();
      ResultSet resultSet = stmt.executeQuery(sql);
      while (resultSet.next()) {
        Map<String, Object> row = new HashMap<>();
        ResultSetMetaData metadata = resultSet.getMetaData();
        // Columns list in table metadata is 1-indexed
        for (int i = 1; i <= metadata.getColumnCount(); i++) {
          row.put(metadata.getColumnName(i), resultSet.getObject(i));
        }
        result.add(row);
      }
      return result;
    } catch (Exception e) {
      throw new JDBCResourceManagerException("Failed to execute SQL statement: " + sql, e);
    }
  }
@Test
  public void testRunSQLStatementShouldThrowErrorWhenDriverFailsToEstablishConnection()
      throws SQLException {
    when(container.getHost()).thenReturn(HOST);
    when(container.getMappedPort(JDBC_PORT)).thenReturn(MAPPED_PORT);
    doThrow(SQLException.class).when(driver).getConnection(any(), any(), any());

    assertThrows(
        JDBCResourceManagerException.class, () -> testManager.runSQLQuery("SQL statement"));
  }