Develop and Download Open Source Software

Browse CVS Repository

Diff of /xoonips/AL/commonal.cc

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.26 by youi, Mon Dec 6 10:17:36 2004 UTC revision 1.27 by aga, Mon Dec 6 11:34:47 2004 UTC
# Line 2  Line 2 
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) );を挿入.
# Line 115  Line 118 
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"
# Line 260  result_t initializeDB( const char* host, Line 264  result_t initializeDB( const char* host,
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 ){
# Line 272  result_t initializeDB( const char* host, Line 277  result_t initializeDB( const char* host,
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

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26