473,406 Members | 2,956 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,406 software developers and data experts.

C Database

i want to know how to create a database of your own using c or c++.
without using any external tools. if any body could provide me an idea
to go by it would help me a lot, also if their is any sample code it
would help me a lot.

Mar 13 '06 #1
3 1547
raviz said:
i want to know how to create a database of your own using c or c++.
without using any external tools. if any body could provide me an idea
to go by it would help me a lot, also if their is any sample code it
would help me a lot.


First step - decide what you mean by "database". If you want to write a
full-blown SQL parsing engine, you're in for the long haul. If you simply
want to be able to store some data in a reasonably generic format and be
able to perform simple Create/Retrieve/Amend/Purge (or, if you prefer,
Create/Retrieve/Update/Delete) on that data, you can do quite a lot with a
bunch of ordinary text (or even binary) files.

At the bottom level, you're going to be using fopen, fread (or, if you're
like me and prefer text format, a custom-written routine to get a complete
line of text, and some parsing code to interpret it for you), fwrite (or
fprintf), fclose, and the like.

How much you build up from that is entirely up to you. You'll need to come
up with some kind of concrete design first, and then have a go at
implementing it. If you get stuck on the C implementation part of it, let
us know what you've got, what you want it to do, and what it's doing
instead, and you'll very likely get good support here. But alas, we don't
have time to do all your design and programming work for you.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)
Mar 13 '06 #2
"raviz" <ra*******@gmail.com> wrote:
i want to know how to create a database of your own using c or c++.
without using any external tools. if any body could provide me an idea
to go by it would help me a lot, also if their is any sample code it
would help me a lot.


Design a database file format or find one you like on
<http://www.wotsit.org/search.asp?s=database>. Then go wild with
fopen(), fwrite(), fread(), fgetpos() and fsetpos().

Sample code? Sure. Decide what you _actually_ want to do ("create a
database" is just a tad vague), then do a websearch.

Richard
Mar 13 '06 #3
raviz wrote:
i want to know how to create a database of your own using c or c++.
without using any external tools. if any body could provide me an idea
to go by it would help me a lot, also if their is any sample code it
would help me a lot.


If you want to see what a relational database implemented in C looks
like, check out the freely available and open source database engine
SQLite:
http://www.sqlite.org/

-Charlie

Mar 13 '06 #4

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

Similar topics

0
by: Cherrish Vaidiyan | last post by:
sir, The following are the steps that i followed in setting up standby database on Red hat Linux 9. i am using Oracle 9i. i have followed the steps in this site : ...
6
by: Marvin Libson | last post by:
Hi All: I am running DB2 UDB V7.2 with FP11. Platform is Windows 2000. I have created a java UDF and trigger. When I update my database I get the following error: SQL1224N A database...
8
by: Kamlesh | last post by:
Hi, How do I know the physical database path of a database. When I goto the DB2INSTANCE users's directory (/home/db2inst1), I see following folders: /db2inst1/NODE0000/SQL00001...
1
by: pintur | last post by:
The message is: SQL1036C Errore di I/O durante l' accesso al database. SQLSTATE=58030 what is the proble? what for restore tables? thanks
3
by: josh.kuo | last post by:
Sorry about the subject, I can't think of a better one. I recently wrote some PHP classes that I think might be of interest to this group. Since I have been reaping the benefits of reading news...
8
by: morleyc | last post by:
Hi, until recently i was quite happy to add data sources from mssql database in visual studio and drag the datasets directly onto the form this creating a directly editable form which worked well....
0
by: Jack | last post by:
Training Classes for Oracle10g, 9i, 8i Certification training in Oracle10g and 9i: DBA, Developer, Discoverer. training conducted at your location worldwide. Courseware licensing also available....
0
by: Winder | last post by:
Training Classes for Oracle10g, 9i, 8i Certification training in Oracle10g and 9i: DBA, Developer, Discoverer. training conducted at your location worldwide. Courseware licensing also available....
0
by: Laurynn | last post by:
# (ebook - pdf) - programming - mysql - php database applicati # (Ebook - Pdf)Learnkey How To Design A Database - Sql And Crystal Report # (ebook-pdf) E F Codd - Extending the Database Relational...
9
by: Peter Duniho | last post by:
Is there a straightfoward API in .NET that allows for inspection of a database? That is, to look at the structure of the database, without knowing anything in advance about it? For example,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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.