~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to examples/simple.cc

  • Committer: Olaf van der Spek
  • Date: 2011-08-20 14:28:25 UTC
  • mto: This revision was merged to the branch mainline in revision 2409.
  • Revision ID: olafvdspek@gmail.com-20110820142825-ij88ywkdhpfm8ecp
Read conf files

Show diffs side-by-side

added added

removed removed

Lines of Context:
84
84
 
85
85
  drizzle::drizzle_c drizzle;
86
86
  drizzle::connection_c* con= new drizzle::connection_c(drizzle);
87
 
  con->set_tcp(host, port);
88
 
  con->set_auth(user, password);
 
87
  if (host || port)
 
88
    con->set_tcp(host, port);
 
89
  if (user || password)
 
90
    con->set_auth(user, password);
89
91
  con->set_db("information_schema");
90
92
  drizzle::query_c q(*con, "select table_schema, table_name from tables where table_name like ?");
91
93
  q.p("%");
92
 
  cout << q.read() << endl;
93
94
  try
94
95
  {
95
96
    drizzle::result_c result= q.execute();
 
97
    cout << q.read() << endl;
96
98
    while (drizzle_row_t row= result.row_next())
97
99
    {
98
100
      for (int x= 0; x < result.column_count(); x++)