Browse CVS Repository
Diff of /xoonips/AL/commonal.cc
Parent Directory
| Revision Log
| Revision Graph
| Patch
| 2 |
* |
* |
| 3 |
* $Revision$ |
* $Revision$ |
| 4 |
* $Log$ |
* $Log$ |
| 5 |
|
* Revision 1.27 2004/12/06 11:34:47 aga |
| 6 |
|
* ・uninitializeDB()を追加. |
| 7 |
|
* |
| 8 |
* Revision 1.26 2004/12/06 10:17:36 youi |
* Revision 1.26 2004/12/06 10:17:36 youi |
| 9 |
* mysql_use_resultの取得結果を残さず取り出すため, |
* mysql_use_resultの取得結果を残さず取り出すため, |
| 10 |
* while( row = mysql_fetch_row(result) );を挿入. |
* while( row = mysql_fetch_row(result) );を挿入. |
| 118 |
#include <mysql.h> |
#include <mysql.h> |
| 119 |
#include <errmsg.h> |
#include <errmsg.h> |
| 120 |
#include <string> |
#include <string> |
| 121 |
|
#include <assert.h> |
| 122 |
using namespace std; |
using namespace std; |
| 123 |
|
|
| 124 |
#include "common.h" |
#include "common.h" |
| 264 |
|
|
| 265 |
dbprefix = prefix; |
dbprefix = prefix; |
| 266 |
|
|
| 267 |
|
|
| 268 |
// 初期化と接続 |
// 初期化と接続 |
| 269 |
mysql = mysql_init(NULL); |
mysql = mysql_init(NULL); |
| 270 |
if ( mysql == NULL ){ |
if ( mysql == NULL ){ |
| 277 |
} |
} |
| 278 |
|
|
| 279 |
return RES_OK; |
return RES_OK; |
| 280 |
|
} |
| 281 |
|
|
| 282 |
|
/** |
| 283 |
|
* |
| 284 |
|
* DB接続があれば、それを開放する。 |
| 285 |
|
* |
| 286 |
|
* @param なし |
| 287 |
|
* @return RES_OK |
| 288 |
|
*/ |
| 289 |
|
result_t uninitializeDB() |
| 290 |
|
{ |
| 291 |
|
if ( mysql != NULL ){ |
| 292 |
|
mysql_close( mysql ); |
| 293 |
|
mysql = NULL; |
| 294 |
|
} |
| 295 |
|
|
| 296 |
|
return RES_OK; |
| 297 |
} |
} |
| 298 |
|
|
| 299 |
|
|
|
|
Legend:
| Removed from v.1.26 |
|
| changed lines |
| |
Added in v.1.27 |
|
|
|