Linux环境下proc的配置c/c++操作数据库简单示例
时间:2021-07-01 10:21:17
帮助过:2人阅读
<
string.h>
#include <
string.h>
#include "sqlca.h"
EXEC SQL BEGIN DECLARE SECTION;
char *serverid =
"scott/000110@orcl";
EXEC SQL END DECLARE SECTION;
int main()
{
int ret =
0;
printf("hello....\n");
printf("serverid:%s \n", serverid);
EXEC SQL connect :serverid;
if (sqlca.sqlcode !=
0)
{
ret =
sqlca.sqlcode;
printf("EXEC SQL connect:err, %d\n", ret);
return ret;
}
printf("connect ok\n");
return ret;
}
7.结果:
[oracle@disdader day3]$ ./dm01_hello
hello....
serverid:scott/000110@orcl
connect ok
Linux环境下proc的配置c/c++操作数据库简单示例
标签: