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? 3 1477
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
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 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. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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 :
...
|
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...
|
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...
|
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
|
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...
| |
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....
|
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....
|
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....
|
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...
|
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,...
|
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...
| |
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,...
|
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...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
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...
|
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,...
|
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...
| |
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
| |