diff --git a/core/lib/Drupal/Core/Database/Connection.php b/core/lib/Drupal/Core/Database/Connection.php
index 38342f9..3e9549d 100644
--- a/core/lib/Drupal/Core/Database/Connection.php
+++ b/core/lib/Drupal/Core/Database/Connection.php
@@ -1465,6 +1465,27 @@ protected static function getSQLState(\Exception $e) {
   }
 
   /**
+   * Retrieves the current class from PDO::ATTR_STATEMENT_CLASS.
+   *
+   * @return string
+   *   The class name that is set in the PDO attribute.
+   */
+  public function getCurrentStatementClass() {
+    $attribute = $this->connection->getAttribute(\PDO::ATTR_STATEMENT_CLASS);
+    return isset($attribute[0]) ? $attribute[0] : '';
+  }
+
+  /**
+   * Retrieves the statement class variable.
+   *
+   * @return string
+   *   The class name that is set on the connection class.
+   */
+  public function getStatementClass() {
+    return !empty($this->statementClass) ? $this->statementClass : '';
+  }
+
+  /**
    * Prevents the database connection from being serialized.
    */
   public function __sleep() {
diff --git a/core/tests/Drupal/KernelTests/Core/Database/ConnectionTest.php b/core/tests/Drupal/KernelTests/Core/Database/ConnectionTest.php
index 0cc3627..1753bd3 100644
--- a/core/tests/Drupal/KernelTests/Core/Database/ConnectionTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Database/ConnectionTest.php
@@ -75,6 +75,9 @@ function testConnectionClosing() {
     Database::closeConnection('default', 'default');
     $db2 = Database::getConnection('default', 'default');
 
+    // Opening a new connection should set the statement class attribute in PDO.
+    $this->assertEquals($db2->getStatementClass(), $db2->getCurrentStatementClass(), 'Found expected statement class on new connection.');
+
     // Opening a connection after closing it should yield an object different than the original.
     $this->assertNotIdentical($db1, $db2, 'Opening the default connection after it is closed returns a new object.');
   }
