连接到DATA BASE(ORACLE) [英] Connecting to the DATA BASE(ORACLE)

查看:46
本文介绍了连接到DATA BASE(ORACLE)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

海对所有人说。请告诉我如何通过C程序连接数据库

。我不清楚。

解决方案

sabarish写道:

Hai给所有人。请告诉我如何通过C程序连接到数据库。我不清楚。




嗯,问题完全不在这里,因为我们处理的是

C语言不是全部您可以使用第三个

方库从C谈话的数据库。既然你没有说*哪个*数据库我们甚至不能

指引你去正确的地方。不,不要回复告诉我们哪个

数据库,只需找到处理它的组或邮件列表。


只是为了得到你开始了,我已经看到并使用

后面的表格来打开一个数据库表:

handle = ffisam(0,OF," table",ddf_descriptor );

然而,这可能对你不起作用,因为你几乎可以肯定使用一个完全不同的数据库。

-

Flash Gordon

生活在有趣的时代。

虽然我的电子邮件地址说垃圾邮件,但它是真实的,我读了它。


您好,


通过使用pro * c,您可以连接数据库。什么是你的口碑。首先创建一个

文件并使用扩展名保存为.pc并使用proc

< filename.pc>进行编译。然后使用cc编译它并使用a.out执行它,如果你使用unix操作系统获得



代码如下:


#include< sqlca.h>

main()

{


varchar uid [] =" system",passwd [] =" manager";


EXEC SQL connect:uid标识:passwd;


printf (成功连接到数据库);


/ *你的代码在这里* /

}


kk写道:

你好,

使用pro * c


pro * c是因此,它不属于这个群体的主题。如果你知道

在哪里重定向OP,那么一定要重定向OP。如果你告诉海报他们是OT,你可以将它们重定向到

正确的位置,交叉发布到正确的位置,并且重要的是设置

发布答案/>
跟进到正确的地方。但是,不要只在这里回答OT问题

,因为他们不会因错误而被正确审查。

你可以连接数据库。什么是你的口碑。首先创建一个
文件并使用扩展名保存为.pc并使用proc
< filename.pc>进行编译。然后用cc编译它并用a.out执行它如果你是


请不要使用像u r这样的愚蠢缩写。他们所做的只是让它很难读懂你的帖子,特别是非英语母语人士。

使用unix os。

代码看起来像这样:

#include< sqlca.h>


不是标准的C标题。

main()


varchar uid [] =" system" ;,passwd [] =" manager";

EXEC SQL connect:uid标识:passwd;


这是无效的C因此证明pro * c不是C.

printf(成功连接到数据库);

/ *你的代码在这里* /
}




最后,请加入一些背景,以便人们知道你是什么

回复。建议通常通过谷歌发布如何做到这一点。

-

Flash Gordon

生活在有趣的时代。

虽然我的电子邮件地址是垃圾邮件,但它是真的,我读了它。


Hai to all the people. please tell how can i Connect to the Database
through C program. I have No clarity in that.

解决方案

sabarish wrote:

Hai to all the people. please tell how can i Connect to the Database
through C program. I have No clarity in that.



Well, the question is completely off topic here, since we deal with the
C language not all the databases that you can talk to from C using third
party libraries. Since you have not said *which* database we can''t even
direct you to the correct place. No, don''t post back telling us which
database, just go and find the groups or mailing lists that deal with it.

Just to get you started though, I have seen and used statements of the
following form to open a database table:
handle = ffisam(0,OF,"table",ddf_descriptor);
However, this probably won''t work for you since you are almost certainly
using a completely different database.
--
Flash Gordon
Living in interesting times.
Although my email address says spam, it is real and I read it.


Hello,

By using pro*c you can connect database. what''s ur os. first create a
file and save it with extension name is .pc and compile it with proc
<filename.pc> then compile it with cc and execute it with a.out if u r
using unix os.

the code looks like this:

#include <sqlca.h>
main()
{

varchar uid[]="system",passwd[]="manager";

EXEC SQL connect :uid identified by :passwd;

printf("successfully connected to database");

/* u r code goes here */
}


kk wrote:

Hello,

By using pro*c
pro*c is NOT C. It is therefore off topic on this group. If you know
where to redirect the OP then by all means redirect the OP. You can even
post an answer IF you tell the poster they were OT, redirect them to the
correct place, cross post to the correct place, and importantly set
follow ups to the correct place. However, don''t just answer OT questions
here since they will not be properly vetted for errors.
you can connect database. what''s ur os. first create a
file and save it with extension name is .pc and compile it with proc
<filename.pc> then compile it with cc and execute it with a.out if u r
Please don''t use stupid abbreviations like "u r". All they do is make it
hard to read your post, especially for non-native English speakers.
using unix os.

the code looks like this:

#include <sqlca.h>
Not a standard C header.
main()
{

varchar uid[]="system",passwd[]="manager";

EXEC SQL connect :uid identified by :passwd;
This is not valid C thus proving that pro*c is not C.
printf("successfully connected to database");

/* u r code goes here */
}



Finally, please include some context so that people know what you are
replying to. Advice is REGULARLY posted on how to do this through Google.
--
Flash Gordon
Living in interesting times.
Although my email address says spam, it is real and I read it.


这篇关于连接到DATA BASE(ORACLE)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆