List:MySQL++« Previous MessageNext Message »
From:牛 坤 Date:April 14 2005 8:08am
Subject:Can I use mysql++ this way?
View as plain text  
Dear mysql++ users,

I've got a strange question when coding.
I have the following code:

#include<msyql++.h>

#define MAX 20

class Connect
{
  private:
    char host[ MAX ];
    char user[ MAX ];
    char password[ MAX ];
    char dbname[ MAX ];
    mysqlpp::Connection connection;
  public:
    Connect( char host[] = NULL, char user[] = NULL, char password[] = NULL 
)
    {
        this -> host = host;
        this -> user = user;
        this -> password = password;
        this -> connection = mysqlpp::Connection( mysqlpp::use_exceptions 
);
    }
    bool connect( char dbname[] )
    {
        this -> dbname = dbname;
        return ( this ->  connection ).connect( this -> dbname, this -> 
host, this -> user, this -> password );
    }
};

int
main( int argc, char **argv )
{
    Connect conn( "localhost", "user", "password" );
    conn.connect( "dbname" );
    return 0;
}

I can always see exception thrown out of libmysqlpp.so

My os is redhat linux9 and redhat linux advanced server 3 update2.
My mysql is 4.1.10.
Can anyone help me solve the problem?

Thanks in advance. And any help would be appreciated.

_________________________________________________________________
免费下载 MSN Explorer:   http://explorer.msn.com/lccn  

Thread
Can I use mysql++ this way?牛 坤18 Apr
  • Re: Can I use mysql++ this way?Warren Young18 Apr
Re: Can I use mysql++ this way?Tommy18 Apr