473,397 Members | 2,068 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Connect to DATA BASE (ORACLE)

Hi to all the people. please will u tell how can i Connect to the
Database through C program. i have No clarity in that.
Jun 27 '08 #1
7 2672
In article <g1**********@aioe.org>, sanjay <no****@nospam.comwrote:
>Hi to all the people. please will u tell how can i Connect to the
Database through C program. i have No clarity in that.
It is not possible using only routines that are part of standard C.
You will need to use routines that are not part of C itself
(though, of course, calling those routines from within your C program).

For some operating systems and some databases, you can use
operating-system supplied routines to make the connection, with
the operating system providing a standard connection interface
that is database independant.

For other operating systems, or for databases that do not have
that kind of interface available, or for doing operations that are
not within the scope of those operating-system supplied interfaces,
you will have to use routines supplied by the database manufacturer.

Some databases provide an interface that is based upon TCP/IP
network protocols, with it being expected that you will do all
the hand-coding to open a network connection and communicate back
and forth with the database.

Clearly the details of how you should proceed vary, based upon
product and operating system differences. There is no standard way
to communicate with -all- kinds of databases (though some have
evolved well-defined interfaces intended for use amongst multiple
competing products.)

For further details, you will need to consult a newsgroup
that deals with your particular database, and possibly also a
newsgroup that deals with your operating system.
--
"He wove a great web of knowledge, linking everything together,
and sat modestly at a switchboard at the center, eager to help."
-- Walter Kerr
Jun 27 '08 #2
sanjay wrote:
>
Hi to all the people. please will u tell how can i Connect to the
Database through C program. i have No clarity in that.
Better make up your mind. Do you want u to help you, or do you
want 'all the people' to help you? U hasn't posted here for quite
some time. In addition, a Database is probably off-topic in this
newsgroup. At any rate, I would consider using text.

--
[mail]: Chuck F (cbfalconer at maineline dot net)
[page]: <http://cbfalconer.home.att.net>
Try the download section.
** Posted from http://www.teranews.com **
Jun 27 '08 #3
On May 23, 3:18*pm, sanjay <nos...@nospam.comwrote:
Hi to all the people. please will u tell how can i Connect to the
Database through C program. i have No clarity in that.
Probably, one of the oracle or database newsgroups is a better bet
than news:comp.lang.c

The language itself does not offer any pre-defined method to do that.

There are ways to connect to a database that have standards for them:

1. Embedded C or Module Language C : http://www.itl.nist.gov/div897/ctg/sql_form.htm
2. ODBC or SQL/CLI (see : http://www.sqlsummit.com/DataAcce.htm )
3. OLEDB (see : http://www.sqlsummit.com/DataAcce.htm )
4. .NET (assumes Windows or MONO) (see : http://www.sqlsummit.com/DataAcce.htm
)

You can also connect with a database specific API. Oracle's API is
called OCI: http://www.oracle.com/technology/tech/oci/index.html
You can also connect with a tool designed for that sort of thing like
OTL: http://otl.sourceforge.net/

Probably, you will want to find a newsgroup that caters to your exact
question (which is not really about the C programming language at
all).
Jun 27 '08 #4
Hi walter thx for ur reply. it is interesting to read but when i go back
to coding it still hasnt helped me know what to type :(

Walter Roberson wrote:
In article <g1**********@aioe.org>, sanjay <no****@nospam.comwrote:
>>Hi to all the people. please will u tell how can i Connect to the
Database through C program. i have No clarity in that.


It is not possible using only routines that are part of standard C.
You will need to use routines that are not part of C itself
(though, of course, calling those routines from within your C program).

For some operating systems and some databases, you can use
operating-system supplied routines to make the connection, with
the operating system providing a standard connection interface
that is database independant.

For other operating systems, or for databases that do not have
that kind of interface available, or for doing operations that are
not within the scope of those operating-system supplied interfaces,
you will have to use routines supplied by the database manufacturer.

Some databases provide an interface that is based upon TCP/IP
network protocols, with it being expected that you will do all
the hand-coding to open a network connection and communicate back
and forth with the database.

Clearly the details of how you should proceed vary, based upon
product and operating system differences. There is no standard way
to communicate with -all- kinds of databases (though some have
evolved well-defined interfaces intended for use amongst multiple
competing products.)

For further details, you will need to consult a newsgroup
that deals with your particular database, and possibly also a
newsgroup that deals with your operating system.
Jun 27 '08 #5
kk
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.pcthen 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 */

}
sanjay wrote:
Hi walter thx for ur reply. it is interesting to read but when i go back
to coding it still hasnt helped me know what to type :(

Walter Roberson wrote:
>In article <g1**********@aioe.org>, sanjay <no****@nospam.comwrote:
>>Hi to all the people. please will u tell how can i Connect to the
Database through C program. i have No clarity in that.

It is not possible using only routines that are part of standard C.
You will need to use routines that are not part of C itself
(though, of course, calling those routines from within your C program).

For some operating systems and some databases, you can use
operating-system supplied routines to make the connection, with
the operating system providing a standard connection interface
that is database independant.

For other operating systems, or for databases that do not have
that kind of interface available, or for doing operations that are
not within the scope of those operating-system supplied interfaces,
you will have to use routines supplied by the database manufacturer.

Some databases provide an interface that is based upon TCP/IP
network protocols, with it being expected that you will do all
the hand-coding to open a network connection and communicate back
and forth with the database.

Clearly the details of how you should proceed vary, based upon
product and operating system differences. There is no standard way
to communicate with -all- kinds of databases (though some have
evolved well-defined interfaces intended for use amongst multiple
competing products.)

For further details, you will need to consult a newsgroup
that deals with your particular database, and possibly also a
newsgroup that deals with your operating system.
Jun 27 '08 #6
sanjay wrote:
Hi walter thx for ur reply. it is interesting to read but when i go
back to coding it still hasnt helped me know what to type :(
You still aren't getting the message. You are in the wrong group.
Either find a group or mailing list for your software package, or try
comp.databases.

Drop the text-speak.

Please don't top-post. Your replies belong following or interspersed
with properly trimmed quotes. See the majority of other posts in the
newsgroup, or:
<http://www.caliburn.nl/topposting.html>


Brian
Jun 27 '08 #7
kk wrote:
Hello,
Please don't top-post. Your replies belong following or interspersed
with properly trimmed quotes. See the majority of other posts in the
newsgroup, or:
<http://www.caliburn.nl/topposting.html>
Jun 27 '08 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Benson, John | last post by:
Hi, I'm a non-Oracle guy just starting to use Python to explore Oracle. I enclose the Python command prompt log for the usage example further down with only the user, password and host names...
4
by: Ellen K. | last post by:
Hi all, Being that so far I didn't get an answer to my below problem on the Oracle newsgroup, I figured it couldn't hurt to try here. While at my current job I've been working with mostly SQL...
5
by: jrefactors | last post by:
My machine is Windows XP with Oracle 9.2 Home; IIS and Oracle are in the same box. I have tried both Oracle OLEDB Provider and Microsoft ODBC For Oracle, but both not working. For Microsoft...
6
by: ´ď´ď | last post by:
How to connect asp.net with Oracle Database? Where and How to? Thanks very much.
8
by: danbredy | last post by:
Hi, I'm attempting to connect to an Oracle database using SQL Server 2005 Express (OS is Windows XP Professional) and having absolutely no luck. Here is the information SQL Plus gives me about...
7
by: skishorev | last post by:
Hi, How shall i connect c++ with any data base(like oracle , xml etc.).Plz Let me know if anybody familiar with this. Thanks&regards, saikishore
7
by: D. Patrick | last post by:
I need to connect to an Oracle database. I've never done it before. I see that with framework 1.1 you had to download ODP.NET from Oracle's site in order for the framework classes to even work....
9
by: D. Patrick | last post by:
I need to connect to an Oracle database. I've never done it before. I see that with framework 1.1 you had to download ODP.NET from Oracle's site in order for the framework classes to even work....
3
by: nandhanvijay | last post by:
hi every am trying to connect data base in vb.net but am unable to connect. As per the book am following that says to connect to data base go to tools menu connect to data base option. u will...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.