Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 11.0.1 (中文) » UltraLite - C 及 C++ 编程 » 应用程序开发 » 使用 UltraLite C++ API 开发应用程序

 

使用 UltraLite 命名空间

UltraLite C++ 接口提供一组名称以 UltraLite_ 为前缀的类(如 UltraLite_Connection 和 UltraLite_DatabaseManager)。其中每个类的大部分函数都使用附加字符串 _iface 的基础接口实现函数。例如,UltraLite_Connection 类从 UltraLite_Connection_iface 实现函数。

当显式使用 UltraLite 命名空间时,可使用较短的名称引用每个类。如果您使用 UltraLite 命名空间,则不必将连接声明为 UltraLite_Connection 对象,而是可以将其声明为 Connection 对象:

using namespace UltraLite;
ULSqlca sqlca;
sqlca.Initialize();
DatabaseManager * dbMgr = ULInitDatabaseManager(sqlca);
Connection *  conn = UL_NULL;

作为此体系结构的结果,本章中的代码示例使用如 DatabaseManager、Connection 和 TableSchema 的类型,但详细信息的链接可能分别指向 UltraLite_DatabaseManager_iface、UltraLite_Connection_iface 和 UltraLite_TableSchema_iface。