Forum     

Go Back   Digit Technology Discussion Forum > Software > Programming
Register FAQ Calendar Mark Forums Read

Programming The destination for developers - C, C++, Java, Python and the lot


Reply
 
LinkBack Thread Tools Display Modes
Old 09-01-2012, 01:58 AM   #1 (permalink)
VIP
 
RazorbladeXtreme's Avatar
 
Join Date: May 2008
Location: Jaipur
Posts: 187
Lightbulb A database without using DBMS


I want to store textual encoded data in a file whose internal structure is that of a database's .

The scenario requires saving pages of a diary - one for each day (specific date). I do not want to use 3rd party softwares and want to get it done with programming language alone via file handling (or the apt method).

Could anyone enlighten me how this could be approached (Java) ?



I also need to discuss a bit of cryptography.
I maybe read something about this somewhere and since have assumed that secure systems don't store actual user passwords but use cryptographic hashing algorithm on the password and store the result. When the user re-enters password, the algorithm is applied on the input and the result of this one is matched with the one in database.

The pages I want to encode - I've thought of using DES with user's password being the deciphering key, and username and password's hash in separate plaintext database file. How feasible, secure, and efficient does this sound ?

Please speak of any errors you think in this design.

and, I know this is not as easy as I am thinking
__________________
Twitter: twitter.com/SharmaTushar
Facebook: facebook.com/tushar.sharma
RazorbladeXtreme is offline   Reply With Quote
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 16-01-2012, 02:48 PM   #2 (permalink)
In The Zone
 
Join Date: Mar 2004
Location: Welcome to the Matrix
Posts: 215
Default Re: A database without using DBMS

Store it in a flat file in a simple 3 part format.
First part will tell how many bytes data you have to read
Second part can hold date
Third part will have your text data.

You can have Monthly/Yearly data files.
__________________
----
enjoy is offline   Reply With Quote
Old 14-03-2012, 02:54 PM   #3 (permalink)
In The Zone
 
pranav0091's Avatar
 
Join Date: Jul 2011
Location: Wherever I am
Posts: 290
Default Re: A database without using DBMS

Here's one very simple way of doing it.

Write everything onto a plain file, and use a special byte-sequence to mark the end of a post.

As for the cryptography part remember that (if you are building this app just for fun, which is very likely) then bitwise XORing is a ridiculously simple encryption procedure.

Bitwise XOR the data-file once and you get the ciphertext-file, repeat the procedure on the ciphertext and get back your original file. As simple as that.

*edit*
My bad, didnt notice the date...
Anyways will just let the post lie here just in case somebody finds it useful.
__________________
Spoiler:
HP Pavillion dv4 3016tx | i5 2.33GHz | ATI HD6750M 1GB | 4GB RAM | 500GB HDD

Panasonic HJE120 IEM

N70

Last edited by pranav0091; 14-03-2012 at 02:57 PM. Reason: mistakes
pranav0091 is offline   Reply With Quote
Old 14-03-2012, 03:16 PM   #4 (permalink)
Wahahaha~!
 
Faun's Avatar
 
Join Date: Dec 2006
Location: Pune/there
Posts: 7,675
Default Re: A database without using DBMS

XML..................
__________________
Blog | Flickr | Battlelog
Spoiler:
Asus Z68 V-Pro|i5 2500k|TRUE Black|Ripjaws X|U2311H|N560GTX|D7000|XONAR STX|RE272|RE0|CC51|XE200PRO Walnut| TD II V2| Ultraphile|N5800

Mono
Faun is online now   Reply With Quote
Old 14-03-2012, 04:14 PM   #5 (permalink)
BIOS Terminator
 
nims11's Avatar
 
Join Date: Apr 2008
Location: Ranchi
Posts: 816
Default Re: A database without using DBMS

+1 to XML
easy to manipulate and has huge support in many languages by means of 3rd party libraries
__________________
Arch Linux is kind of a bonzai tree, over years u try new things, make small tweaks, and end up with a system that is unique, elegant, and does exactly what u designed it to do.
Hostapd : The Linux Way to create Virtual Wifi Access Point
My Blog
nims11 is online now   Reply With Quote
Old 15-03-2012, 05:13 PM   #6 (permalink)
Alpha Geek
 
masterkd's Avatar
 
Join Date: Feb 2011
Location: Kolkata
Posts: 521
Default Re: A database without using DBMS

for cryptography use md5..google a little bit, you'll find the jar file and 5-6 lines of code required to do that..really simple huh!!
__________________
i5 2500K|P8Z68 V PRO|560Ti Hawk|G Skill 8GB 1600MHz|SG 500 GB|WD Passport 1TB|TX850V2|690II Advanced|BenQ G2420HD|Razer Cyclosa Bundle|Razer Goliathus|APC 1.1 KVA|DLink 2730U WiFi Router|Windows 7 X64
Samsung Galaxy Note :hyper:

Steam
masterkd is offline   Reply With Quote
Old 15-03-2012, 11:19 PM   #7 (permalink)
Section Moderator
 
gopi_vbboy's Avatar
 
Join Date: Mar 2007
Location: Hyderabad
Posts: 1,186
Default Re: A database without using DBMS

xml...but as database schema gets complex,it gets complex to parse the nodes...xpath is easiest way to parse in such case...you may also use xsl to present data in web...to make it cross platform n independent of os...
gopi_vbboy is online now   Reply With Quote
Old 15-03-2012, 11:32 PM   #8 (permalink)
Mmmph!!!
 
doomgiver's Avatar
 
Join Date: Nov 2010
Location: Mmmphhmph Mmphph
Posts: 1,408
Default Re: A database without using DBMS

try some nosql.
like mongoDB (its humongous!)
__________________
Mmmphh-mphhhh-mmphh mhh!!!

Steam : doomgiver
doomgiver is offline   Reply With Quote
Old 16-03-2012, 05:38 AM   #9 (permalink)
The Smaller Bang
 
MetalheadGautham's Avatar
 
Join Date: Sep 2007
Location: Gautham City
Posts: 7,489
Default Re: A database without using DBMS

If someone wants to avoid the overhead of a DBMS server running all the time, the best way to go about is to use SQLite3. SQLite3 offers an embedded DBMS which is inside a single file and this can be queried and data can be retrieved from this just like an ordinary DBMS and it provides all basic DBMS features.

Check this out: http://stackoverflow.com/questions/4...ava-and-sqlite
__________________
http://TheSmallerBang.wordpress.com
eMachines E725 - T4400 2.2GHz, 1GB, 160GB
Nokia 5130XM * T-Sonic 610 2GB
Nokia 2323C * Samsung Galaxy Y
Apple iPad 2 16GB WiFi
MetalheadGautham is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


 
Latest Threads
- by Charan
- by Sarath
- by clmlbx

Advertisement




All times are GMT +5.5. The time now is 12:38 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2