<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">--- dist/examples/standalone_example_docs1.cpp	2017-05-10 12:14:59.000000000 -0400
+++ macports/examples/standalone_example_docs1.cpp	2018-03-03 01:05:56.000000000 -0500
@@ -34,6 +34,7 @@
   (and mysql_connection.h). This will reduce your build time!
 */
 #include "mysql_connection.h"
+#include "examples.h"
 
 #include &lt;cppconn/driver.h&gt;
 #include &lt;cppconn/exception.h&gt;
@@ -42,8 +43,14 @@
 
 using namespace std;
 
-int main(void)
+int main(int argc, const char **argv)
 {
+static const string url(argc &gt;= 2 ? argv[1] : EXAMPLE_HOST);
+static const string user(argc &gt;= 3 ? argv[2] : EXAMPLE_USER);
+static const string pass(argc &gt;= 4 ? argv[3] : EXAMPLE_PASS);
+static const string database(argc &gt;= 5 ? argv[4] : EXAMPLE_DB);
+
+
 cout &lt;&lt; endl;
 cout &lt;&lt; "Running 'SELECT 'Hello World!' AS _message'..." &lt;&lt; endl;
 
@@ -55,9 +62,9 @@
 
   /* Create a connection */
   driver = sql::mysql::get_driver_instance();
-  con = driver-&gt;connect("tcp://127.0.0.1:3306", "root", "root");
+  con = driver-&gt;connect(url, user, pass);
   /* Connect to the MySQL test database */
-  con-&gt;setSchema("test");
+  con-&gt;setSchema(database);
 
   stmt = con-&gt;createStatement();
   res = stmt-&gt;executeQuery("SELECT 'Hello World!' AS _message");
</pre></body></html>