title: mysql connector c++ wrapper
body: <p>I found a wrapper code for the mysql connector c++ and now I want to know, how can I use the current connection on every cpp file?</p>
  
  <p>Link to the wrapper: <a href="https://github.com/eduardocasas/MySQL-Connector-Cpp-Wrapper-Class" rel="nofollow">https://github.com/eduardocasas/MySQL-Connector-Cpp-Wrapper-Class</a></p>
  
  <p>Currently I do queries like this:</p>
  
  <pre><code>MySQLConnWrapper conn;
  conn.connect();
  conn.switchDb("database");
  conn.execute("Query");
  conn.fetch(); 
  </code></pre>
  
  <p>but I would like to know, how can I do something like this:
  I write on the main function:</p>
  
  <pre><code>MySQLConnWrapper conn;
  conn.connect();
  conn.switchDb("database");
  </code></pre>
  
  <p>then on other .cpp files I only have to do</p>
  
  <pre><code>conn.execute("Query");
  conn.fetch(); 
  </code></pre>
  
  <p>any idea how I could do this?</p>