Exemplo n.º 1
0
bool ping_store::create_tbl(acl::db_handle& db)
{
    if (db.tbl_exists("host_status_tbl"))
        logger("host_status_tbl exist");
    else if (db.sql_update(CREATE_HOST_STATUS_TBL) == false)
    {
        logger_error("sql(%s) error", CREATE_HOST_STATUS_TBL);
        return (false);
    }
    else
        logger("create table host_status_tbl ok");

    if (db.tbl_exists("ping_status_tbl"))
        logger("ping_status_tbl exist");
    else if (db.sql_update(CREATE_PING_STATUS_TBL) == false)
    {
        logger_error("sql(%s) error", CREATE_PING_STATUS_TBL);
        return (false);
    }
    else
        logger("create table ping_status_tbl ok");
    return (true);
}
Exemplo n.º 2
0
static bool tbl_create(acl::db_handle& db)
{
	if (db.tbl_exists("group_tbl"))
		return (true);
	if (db.sql_update(CREATE_TBL) == false)
	{
		printf("sql error\r\n");
		return (false);
	}
	else
	{
		printf("create table ok\r\n");
		return (true);
	}
}
Exemplo n.º 3
0
bool pop3_store::create_tbl(acl::db_handle& db)
{
	if (db.tbl_exists("pop3_tbl"))
	{
		logger("pop3_tbl table exist");
		return (true);
	}
	else if (db.sql_update(CREATE_TBL) == false)
	{
		logger_error("sql(%s) error", CREATE_TBL);
		return (false);
	}
	else
	{
		logger("create table pop3_tbl ok");
		return (true);
	}
}