【问题标题】:Fetching database from MySQL to SQLite从 MySQL 获取数据库到 SQLite
【发布时间】:2010-10-03 23:28:31
【问题描述】:

我正在尝试完成一个 iPhone 应用程序。为此,我需要将数据库从 MySQL 获取到 SQLite。对于这种情况,我确实使用了如下代码-

MCPConnection *theConnec;
MCPResult *theRes;
//initialize connection string vars
NSString *dbURL = @"XXXXXX";
NSString *userName = @"XXXXXX";
NSString *pass = @"XXXXXX";
//open connection to database
theConnec = [theConnec initToHost:dbURL withLogin:userName password:pass usingPort:3306];
//NSLog(@"The connection to database was successfull");
[theConnec selectDB:@"XXXXXX"];
//{
// NSLog(@"Database found");
//}
//else
//{
// NSLog(@"Database not found");
//}
theRes = [theConnec queryString:@"select * from seahawk_tag"];
//get the number of rows
NSInteger numberOfRows = [theRes numofRows];
NSLog(@"Query of MySQL Database %@", numberOfRows);
return NSApplicationMain(argc, (const char **) argv);
[theConnec release];

但是这段代码不能正常工作。这里还提到我使用了一些框架,如 cocoa.framework、cocos2d、openGLES.framework、openAL.framework、APPKit.framework、MCPKit.framework、Quartzcore.framewrok。 最后我收到一条错误消息,提示 CIColer.h 丢失。

朋友们,如果您知道解决方案或者您有其他代码,请帮助我

【问题讨论】:

  • 你可以把代码标签放在代码周围。现在看起来加密了。

标签: mysql ios sqlite cocos2d-iphone


【解决方案1】:

您是问如何轮询远程数据库,还是如何预导出?

轮询远程数据库和导入数据应该就像打开远程数据库的套接字,执行查询,然后再次关闭一样简单。

【讨论】:

    猜你喜欢
    • 2015-11-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-03-26
    • 1970-01-01
    • 1970-01-01
    • 2016-04-02
    • 2013-07-28
    相关资源
    最近更新 更多