Go Back   CodingForums.com > :: Server side development > Java and JSP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-16-2009, 07:46 PM   PM User | #1
DELOCH
Regular Coder

 
DELOCH's Avatar
 
Join Date: Apr 2006
Location: Canada
Posts: 537
Thanks: 4
Thanked 2 Times in 2 Posts
DELOCH is an unknown quantity at this point
java variable storage

sometimes i want to make information that is stored on the computer in a place specified by the user... here's a scenario:

A person downloads a mysql server, they say some information for it such as where to install it and such.

I need to do a similar thing and save information at a specified place that is accessable to the program at runtime without re-stating all the information.

I have 2 solutions:
1. Make environment variable { portability problem?, i go no clue how... }
2. Make the installation path firm.

How should i save information that is vital at program startup(for example where to find the info file, i just need to store the path where it is)

another problem i got is that I wanna give a shot at making a primitive server that uses folders as a database and files with special format(Which i will make) to be the tables.
The problem is that i wanna store password and username of the server somewhere... but my problem is that anyone can delete that file or personally encode a file using the algorithm im using and put that jibbrish into the file to change password. How do i make the file safe or what is the approach to that.

thanks ahead of time
DELOCH is offline   Reply With Quote
Old 01-17-2009, 05:14 PM   PM User | #2
oracleguy
Rockstar Coder


 
Join Date: Jun 2002
Location: USA
Posts: 9,043
Thanks: 1
Thanked 322 Times in 318 Posts
oracleguy is a jewel in the roughoracleguy is a jewel in the roughoracleguy is a jewel in the rough
Quote:
Originally Posted by DELOCH View Post
but my problem is that anyone can delete that file or personally encode a file using the algorithm im using and put that jibbrish into the file to change password. How do i make the file safe or what is the approach to that.
You need to rely on the filesystem security to keep unauthorized users out of that file then.
__________________
OracleGuy
oracleguy is offline   Reply With Quote
Old 01-20-2009, 07:25 AM   PM User | #3
DELOCH
Regular Coder

 
DELOCH's Avatar
 
Join Date: Apr 2006
Location: Canada
Posts: 537
Thanks: 4
Thanked 2 Times in 2 Posts
DELOCH is an unknown quantity at this point
i was wondering how other database servers protect their password...

even if you make it auto run on admin account it'll still be changable if you boot the computer from another cd and remove the file.

of course there are different ways but this is definitely not what mysql does.
DELOCH is offline   Reply With Quote
Old 01-21-2009, 05:25 AM   PM User | #4
servlet
Regular Coder

 
Join Date: Jan 2009
Location: india
Posts: 145
Thanks: 0
Thanked 5 Times in 5 Posts
servlet is an unknown quantity at this point
If you want a file system based database, why do u want to reinvent the wheel, look at http://hsqldb.org/.

You can have configuration in properties files which are placed relative to your project root.

let me know, if you need more help.

-----------------
SN Java Servlet
servlet is offline   Reply With Quote
Old 01-22-2009, 02:59 AM   PM User | #5
DELOCH
Regular Coder

 
DELOCH's Avatar
 
Join Date: Apr 2006
Location: Canada
Posts: 537
Thanks: 4
Thanked 2 Times in 2 Posts
DELOCH is an unknown quantity at this point
if i wanted a database i'd use mysql.

i just want to give a try to making my own primitive database.
It is a good 'connector' to many skills such as file i/o, server/client networking, high level string manipulation.

I already have a diagram... it's rather small to be honest.

The main problem I have is that I don't know how to protect the password file from being edited. Mysql installs on my computer and even though i go on admin account i'm not sure how to 'dumbly remove the password.'.

Though I never tried. Please tell me :|
DELOCH is offline   Reply With Quote
Old 01-22-2009, 06:50 AM   PM User | #6
servlet
Regular Coder

 
Join Date: Jan 2009
Location: india
Posts: 145
Thanks: 0
Thanked 5 Times in 5 Posts
servlet is an unknown quantity at this point
If you are relying totally on file system, then ultimately you have to store passwords into some time of files. You can encrypt passwords using cryptography, you can have your own file type/format. Its not easy for a general user to recover encrypted passwords.
servlet is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

Forum Jump


All times are GMT +1. The time now is 11:50 PM.


Advertisement
Log in to turn off these ads.