def check_connection(self):
if self.connection is None:<EOL><INDENT>if not self.__delayed_connect():<EOL><INDENT>raise NullDatabaseConnectionError("<STR_LIT>")<EOL><DEDENT><DEDENT>
:raises simplesqlite.NullDatabaseConnectionError:
    |raises_check_connection|

:Sample Code:
    .. code:: python

        import simplesqlite

        con = simplesqlite.SimpleSQLite("sample.sqlite", "w")

        print("---- connected to a database ----")
        con.check_connection()

        print("---- disconnected from a database ----")
        con.close()
        try:
            con.check_connection()
        except simplesqlite.NullDatabaseConnectionError as e:
            print(e)

:Output:
    .. code-block:: none

        ---- connected to a database ----
        ---- disconnected from a database ----
        null database connection