ProC 连接Oracle代码

前端之家收集整理的这篇文章主要介绍了ProC 连接Oracle代码前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

<div class="codetitle"><a style="CURSOR: pointer" data="15078" class="copybut" id="copybut15078" onclick="doCopy('code15078')"> 代码如下:

<div class="codebody" id="code15078">
int connectDb()
{
EXEC sql BEGIN DECLARE SECTION;
char username[20];
char password[20];
char connect_string[20];
EXEC sql END DECLARE SECTION; strcpy(username,"lbc1");
strcpy(password,"lbtux");
strcpy(connect_string,"lbc1"); EXEC sql CONNECT :username IDENTIFIED BY :password USING :connect_string;
if ( sqlca.sqlcode < 0 )
{
return -1;
}
}

原文链接:https://www.f2er.com/oracle/65830.html

猜你在找的Oracle相关文章