⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 informix_connect.cpp

📁 SQLAPI C/C++ 连接Oracle 数据库!
💻 CPP
字号:
// example of Informix connection string// tested with version 2.8 and 3.32// replace SERVICE=, HOST=, SERVER=, DATABASE=, UID=, PWD=// with your valuesconst char *sConnectString =	"DRIVER={};"	"SERVICE=ol_deep;"	"HOST=deep;"	"PROTOCOL=OLSOCTCP;"	"SERVER=ol_deep;"	"DATABASE=sysmaster;";void Informix_Connect(){	SAConnection con;	SACommand cmd;	cmd.setConnection(&con);	cmd.setCommandText("Select * from authors");	try	{		con.Connect(//			"DRIVER={};"			"PROTOCOL=olsoctcp;"	// protocol in lower case			"SERVICE=1025;"			"SERVER=ol_dell;"			"HOST=dell.cit;"			"DATABASE=sysmaster;",			"informix", "informix", SA_Informix_Client);		cmd.Execute();	}    catch(SAException &x)    {        // SAConnection::Rollback()        // can also throw an exception        // (if a network error for example),        // we will be ready        try        {            // on error rollback changes            con.Rollback();        }        catch(SAException &)        {        }        // print error message        cout << (const char*)x.ErrText() << endl;    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -