LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 01-18-2005, 03:30 PM   #1
dave bean
Member
 
Registered: Jun 2003
Location: UK
Distribution: Slackware 9.1
Posts: 136

Rep: Reputation: 15
data storage in applications


Hi

I have a program which needs to access a database of information but that the database must be 'enclosed' in the application (no retreiving the data from an external database), how would i go about that ? For instance i have a c++ program which reads from a text file all the data it needs and then stores the data in a hash table until the program exits. Obvioulsy this takes a toll on system memory and is dependant on a easily modifiable text file.

I once made a front end for a database in visual basic. The app used a access database file for the data storage and accessed the data through vb's sql implementation. I didn't like how the data was obviously a data file and could easily be tampered or cracked.

So how do modern apps go about solving this problem, accessing and storing data (taking in to account that data may need to be modified, added etc), and how to enclose the data neatly in the application, by this i mean that in the install directory the user won't see a collection of databases they can extract to tamper.

A good example of this type of program would be a dictionary. How can you implement the database to hold the words in c++, or in java ? If you know how to do it in a different language and the technique is very different to java or c++ please post too.

Thanks
 
Old 01-18-2005, 03:44 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,978
Blog Entries: 11

Rep: Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879
http://www.sqlite.org/
http://freshmeat.net/projects/xbase/
I've never used either, but it may do it for you?


Cheers,
Tink

Last edited by Tinkster; 01-18-2005 at 05:33 PM.
 
Old 01-18-2005, 05:16 PM   #3
Strike
Member
 
Registered: Jun 2001
Location: Houston, TX, USA
Distribution: Debian
Posts: 569

Rep: Reputation: 31
sqlite is good for this, but there's still a file hanging around if you want it to be persistent. There's no real way of doing this very easily... nor do I understand the need to do it.
 
Old 01-18-2005, 05:39 PM   #4
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,269

Rep: Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028
Unless you are going to try to write self modifying code, an external file is needed for persistence between program runs.
Depending on the security requirement, you could save it in binary form (stops casual crackers), or encrypt it if you're really paranoid...
Perhaps you could give us a bit more background as to why you want this ...?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Common Data Storage Woodsman Slackware 1 10-30-2005 10:00 PM
Location for script data storage Skazi Linux - General 1 10-15-2005 09:55 AM
Data Storage Question nodger Programming 5 09-01-2005 05:42 PM
Data storage of LDAP? grubjo Linux - General 1 09-03-2004 10:03 PM
Data Storage and Recovery Docs shahul75 Linux - General 3 09-10-2002 02:28 AM


All times are GMT -5. The time now is 11:08 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration