Documentation Home
MySQL NDB Cluster API Developer Guide
Download this Manual

2.3.16.1 Ndb Class Constructor

Description.  This creates an instance of Ndb, which represents a connection to the NDB Cluster. All NDB API applications should begin with the creation of at least one Ndb object. This requires the creation of at least one instance of Ndb_cluster_connection, which serves as a container for a cluster connection string.

Signature. 

Ndb
    (
      Ndb_cluster_connection* ndb_cluster_connection,
      const char*                    catalogName = "",
      const char*                    schemaName = "def"
    )

Parameters.  The Ndb class constructor can take up to 3 parameters, of which only the first is required:

  • ndb_cluster_connection is an instance of Ndb_cluster_connection, which represents a cluster connection string. (See Section 2.3.17, “The Ndb_cluster_connection Class”.)

    Prior to NDB 7.3.8 and NDB 7.4.3, it was possible to delete the Ndb_cluster_connection used to create a given instance of Ndb without first deleting the dependent Ndb object. (Bug #19999242)

  • catalogName is an optional parameter providing a namespace for the tables and indexes created in any connection from the Ndb object.

    This is equivalent to what mysqld considers the database.

    The default value for this parameter is an empty string.

  • The optional schemaName provides an additional namespace for the tables and indexes created in a given catalog.

    The default value for this parameter is the string def.

Return value.  An Ndb object.

~Ndb() (Class Destructor).  The destructor for the Ndb class should be called in order to terminate an instance of Ndb. It requires no arguments, nor any special handling.


User Comments
Sign Up Login You must be logged in to post a comment.