Advertisement
s_m4rt

Untitled

Nov 24th, 2015
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. Environment* env = Environment::createEnvironment();
  2.  
  3. Connection* conn = env->createConnection( "marta", "marta" );
  4.  
  5. cout << "Environment and Connection created" << endl;
  6.  
  7.  
  8.  
  9. //execute a SQL statement
  10.  
  11. Statement* stmt = conn->createStatement();
  12.  
  13. stmt->setSQL("INSERT into FRUITS (fruit, amt) VALUES ('apple', 10)");
  14.  
  15. stmt->executeUpdate();
  16.  
  17. conn->terminateStatement(stmt);
  18.  
  19.  
  20.  
  21. //terminate environment and connection
  22.  
  23. env->terminateConnection(conn);
  24.  
  25. Environment::terminateEnvironment(env);
  26.  
  27. cout << "Environment and Connection terminated" << endl;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement