473,503 Members | 2,165 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

database

This is a common problem but I haven't exactly found a standard answer as I
seem to have a few different opinions.
If you create a database (each record is stored in an object), then how do
program this for an unknown size of objects , Using C++.

q) what data structures would you use to create the database.

eg)Would a container (vector) with dynamically allocated objects be the
simplest solution?
May 10 '06 #1
3 1476
jagguy wrote:
This is a common problem but I haven't exactly found a standard answer as I
seem to have a few different opinions.
If you create a database (each record is stored in an object), then how do
program this for an unknown size of objects , Using C++.


Two things. First, when you use a database, you usually don't want to
recreate its structure in memory. Query and the use the results
immediately.

Second, if you really want to put the database content in memory, use a
standard container, such as std::vector or std::list. If you insert
once (after querying) and then look up elements frequently, I suggest
using std::vector.
Jonathan

May 10 '06 #2
pp
"Jonathan Mcdougall" <jo***************@gmail.com> wrote in message
news:11*********************@e56g2000cwe.googlegro ups.com...
jagguy wrote:
This is a common problem but I haven't exactly found a standard answer as
I
seem to have a few different opinions.
If you create a database (each record is stored in an object), then how
do
program this for an unknown size of objects , Using C++.


Two things. First, when you use a database, you usually don't want to
recreate its structure in memory. Query and the use the results
immediately.

Second, if you really want to put the database content in memory, use a
standard container, such as std::vector or std::list. If you insert
once (after querying) and then look up elements frequently, I suggest
using std::vector.
Jonathan

May 10 '06 #3

This is a common problem but I haven't exactly found a standard answer as
I
seem to have a few different opinions.
If you create a database (each record is stored in an object), then how
do
program this for an unknown size of objects , Using C++.


Two things. First, when you use a database, you usually don't want to
recreate its structure in memory. Query and the use the results
immediately.

Second, if you really want to put the database content in memory, use a
standard container, such as std::vector or std::list. If you insert
once (after querying) and then look up elements frequently, I suggest
using std::vector.
Jonathan


I hit the reply instead of reply to group so sorry about that.
I can see why so many other people gave me blank answers to my question, as
it isn't a common problem.
With so many 3rd party databases around you don't need to worry about
creating a database structure in your code.
Maybe I was being a little impractical for sure.
May 11 '06 #4

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

Similar topics

0
3314
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
7301
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
7881
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
5945
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
2923
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
4118
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
3284
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
3266
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
2535
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
2325
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
7205
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
7093
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
7287
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
5596
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,...
1
5023
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...
0
4689
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3180
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3170
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
747
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.