mirror of
https://github.com/MariaDB/server.git
synced 2025-08-31 22:22:30 +03:00
updated ndbapi examples
This commit is contained in:
@@ -45,7 +45,18 @@
|
||||
int main()
|
||||
{
|
||||
ndb_init();
|
||||
Ndb* myNdb = new Ndb( "TEST_DB_1" ); // Object representing the database
|
||||
|
||||
Ndb_cluster_connection *cluster_connection=
|
||||
new Ndb_cluster_connection(); // Object representing the cluster
|
||||
|
||||
if (cluster_connection->wait_until_ready(30,30))
|
||||
{
|
||||
std::cout << "Cluster was not ready within 30 secs." << std::endl;
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
Ndb* myNdb = new Ndb( cluster_connection,
|
||||
"TEST_DB_1" ); // Object representing the database
|
||||
NdbDictionary::Table myTable;
|
||||
NdbDictionary::Column myColumn;
|
||||
NdbDictionary::Index myIndex;
|
||||
@@ -250,4 +261,8 @@ int main()
|
||||
APIERROR(myDict->getNdbError());
|
||||
|
||||
delete myNdb;
|
||||
delete cluster_connection;
|
||||
|
||||
ndb_end(0);
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user