卑鄙的张老二 2023-08-29 14:57 采纳率: 0%
浏览 10

主函数怎么写,两个文件中

此代码主函数怎么写


```c++
#include <iDA/iDA.h>

using namespace iPlature;
void Step1()
{
    iDA::Connection con; // 创建连接对象
    try
    {

        //连接数据库

        con.Connect(

            "iplature",     // database name数据库名

            "auth",   // user name

            "auth",   // password

            iDA::iDA_Oracle_Client
        );
        printf("We are connected!\n");
        // Disconnect is optional 断开连接可选
         // autodisconnect will ocur in destructor if needed  如果需要 将自动断开连接
        con.Disconnect();
        printf("We are disconnected!\n");
    }
    catch (iDA::Exception &x)

    {
        // Connection::Rollback() 回滚
         // can also throw an exception   抛出异常
         // (if a network error for example), 假如网络错误
         // we will be ready 准备
        try
        {
            // on error rollback changes  错误回滚更该
            con.Rollback();
        }
        catch (iDA::Exception &)
        {

        }

        // print error message  打印错误信息

        printf("%s\n", x.ErrMsg().c_str());

    }

}




```

  • 写回答

2条回答 默认 最新

  • two15 2023-08-29 16:23
    关注
    
    #include <iDA/iDA.h>
    #include<iostream>
    int main()
    {
    Step1();
    system("pause");
    }
    

    这样?

    评论

报告相同问题?

问题事件

  • 创建了问题 8月29日

悬赏问题

  • ¥15 关于github的项目怎么在pycharm上面运行
  • ¥15 内存地址视频流转RTMP
  • ¥100 有偿,谁有移远的EC200S固件和最新的Qflsh工具。
  • ¥15 找一个QT页面+目标识别(行人检测)的开源项目
  • ¥15 有没有整苹果智能分拣线上图像数据
  • ¥20 有没有人会这个东西的
  • ¥15 cfx考虑调整“enforce system memory limit”参数的设置
  • ¥30 航迹分离,航迹增强,误差分析
  • ¥15 Chrome Manifest扩展引用Ajax-hook库拦截请求失败
  • ¥15 用Ros中的Topic通讯方式控制小乌龟的速度,走矩形;编写订阅器代码