title: MySQL connection realization in C++ object-oriented program
body: <p>I have C++ object-oriented application and I want to make my several different classes to have ability to send mysql queries to database and get results. I want to have single program-lifetime connection with database.
  Additionally: If connection timed out, then I program to still do it's work, but then some class tries to send query, it would get exception.</p>
  
  <p>I read this page: <a href="https://dev.mysql.com/doc/connector-cpp/en/connector-cpp-examples-complete-example-1.html" rel="nofollow">MySQL Connector/C++ Developer Guide</a>
  But there is only iterative example, not OOP.</p>