This is my code. Very simple one. Every time when I run my code, after it
finishes all the work, I use gdb to trace it to "return 0;", after return 0;,
it crashes. I have the same problem to run the example codes. My machine is a
linux box with gcc 3.2.2. I don't know what was wrong.

Thanks a lot.


#include <string>
#include <fstream.h>
#include <iostream>
#include <vector>
#include <sqlplus.hh>
#include <custom.hh>
                                                                             
                               
using namespace std;
                                                                             
                               
int main() {
    try { // its in one big try block
                                                                             
                               
    Connection con(use_exceptions);
    con.connect("pattern","localhost","dzhang","dzhang");
    Query query = con.query();
    query << "select * from adm where ProgramUnit1 = \"DKZMH\" and
ProgramUnit2 = \"INITBL\" ";
    Result res = query.store();
    Row row;
    Result::iterator i;
    for(i = res.begin(); i != res.end(); i++) {
      row = *i;
      cout << row[0] << "\t"
           << row[1] << "\t"
           << row[2] << "\t"
           << row[3] << endl;
    }
    cout << "hello\n";
    return 0;
  } catch (BadQuery &er) { // handle any connection or
                          // query errors that may come up
    return -1;
  } catch (BadConversion &er) { // handle bad conversions
    return -1;
  } catch (exception &er) {
    cerr << "Error: " << er.what() << endl;
    return -1;
  }
  return 0;
}




-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to