3 messages in com.mysql.lists.plusplusRe: Can I use mysql++ this way?| From | Sent On | Attachments |
|---|---|---|
| 牛 坤 | 14 Apr 2005 01:07 | |
| Tommy | 17 Apr 2005 23:52 | |
| Warren Young | 18 Apr 2005 08:50 |
| Subject: | Re: Can I use mysql++ this way?![]() |
|---|---|
| From: | Tommy (to...@tencent.com) |
| Date: | 04/17/2005 11:52:48 PM |
| List: | com.mysql.lists.plusplus |
======= 2005-04-14 16:08:12 您在来信中写道:=======
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;
strcpy(this->host, host); strcpy(this->user, user); strcpy(this->password, password);
try again.
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
-- MySQL++ Mailing List For list archives: http://lists.mysql.com/plusplus To unsubscribe: http://lists.mysql.com/plusplus?unsub=to...@tencent.com
= = = = = = = = = = = = = = = = = = = =
Best Regards
曾小俊 (Tomy) 腾讯科技(深圳)企业产品部 Email: to...@tencent.com Office Tel: ?0755-86013388 ext.8512




