Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    Regular Coder DELOCH's Avatar
    Join Date
    Apr 2006
    Location
    Canada
    Posts
    537
    Thanks
    4
    Thanked 2 Times in 2 Posts

    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

  • #2
    Rockstar Coder
    Join Date
    Jun 2002
    Location
    USA
    Posts
    9,074
    Thanks
    1
    Thanked 328 Times in 324 Posts
    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

  • #3
    Regular Coder DELOCH's Avatar
    Join Date
    Apr 2006
    Location
    Canada
    Posts
    537
    Thanks
    4
    Thanked 2 Times in 2 Posts
    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.

  • #4
    Regular Coder
    Join Date
    Jan 2009
    Location
    india
    Posts
    145
    Thanks
    0
    Thanked 5 Times in 5 Posts
    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

  • #5
    Regular Coder DELOCH's Avatar
    Join Date
    Apr 2006
    Location
    Canada
    Posts
    537
    Thanks
    4
    Thanked 2 Times in 2 Posts
    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 :|

  • #6
    Regular Coder
    Join Date
    Jan 2009
    Location
    india
    Posts
    145
    Thanks
    0
    Thanked 5 Times in 5 Posts
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •