Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 7 of 7

Thread: Completely new to saving Data! need resources to read clear concepts.

  1. #1
    Member
    Join Date
    Feb 2012
    Posts
    106
    My Mood
    Yeehaw
    Thanks
    8
    Thanked 11 Times in 11 Posts

    Default Completely new to saving Data! need resources to read clear concepts.

    preferences is interesting but too lightweight since its used for primitives. (thanks Sean)

    Completely new to data basing, any good resources to start with? (looking for learning info so it doesn't have to address my code because I have some studying to do I fear)


  2. #2
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,372
    Thanks
    183
    Thanked 836 Times in 779 Posts
    Blog Entries
    5

    Default Re: Completely new to saving Data! need resources to read clear concepts.

    Not sure I understand the requirements, do you just want to save user preferences? What context (is the a standalone application, applet, webstart, webapp?) A database might be overkill, rather something like a preference file associated with the application might be more appropriate. If a standalone application, just save the file relative to the application, read the file using standard I/O, and you can format it however you wish (I always prefered xml given its architecture).

  3. #3
    Member
    Join Date
    Feb 2012
    Posts
    106
    My Mood
    Yeehaw
    Thanks
    8
    Thanked 11 Times in 11 Posts

    Default Re: Completely new to saving Data! need resources to read clear concepts.

    If you are willing to compile a 1 folder 7 class program I would be happy to post the program and explain it very specifically.

    Otherwise, to be honest I have no clue what I need, I just know its not preferences.
    Answering specific questions:

    (is the a standalone application, applet, webstart, webapp?)
    Currently standalone application, because I haven't gotten to that web part of the functionality, but the last step will be to have multiple users/computers access the same instance of program running (around 6 maximum) the state will be saved only on one computer though, they only need access to the interface.

    (do you just want to save user preferences?)
    I THINK(not sure) it will be more then that. My program is a GUI JFrame with border layout effecting what I consider to be a program state. The bulk of it is a "grid" JPanel that is filled with smaller square "tile" JPanels, the tiles use cardlayout to store at max 3 more JPanel custom "people" objects, and at minimum 1. (these "people" can probably be handled by something smaller and text based.)

    (If a standalone application, just save the file relative to the application, read the file using standard I/O.)
    This is how I would have to solve the problem if I am unable to find a more fitting solution. I can get around the complexity, its more about having 200 JPEGs in a folder, and loading them, just seems like lot of work for the program to do it this way.

    also I would like to prevent the user from accessing "saved" data with out using the program.

    Ill post the code if anyone is willing to compile it and run it. The program itself only has basic functionality, but it is tested and debugged.
    Thanks!
    Jonathan

  4. #4
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,372
    Thanks
    183
    Thanked 836 Times in 779 Posts
    Blog Entries
    5

    Default Re: Completely new to saving Data! need resources to read clear concepts.

    (do you just want to save user preferences?)
    I THINK(not sure) it will be more then that. My program is a GUI JFrame with border layout effecting what I consider to be a program state. The bulk of it is a "grid" JPanel that is filled with smaller square "tile" JPanels, the tiles use cardlayout to store at max 3 more JPanel custom "people" objects, and at minimum 1. (these "people" can probably be handled by something smaller and text based.)
    I still don't understand the requirements. It sounds like you want to save the user's work, or what they've done so when they restart the application the user's work is restored, which sound an awful lot like having the user save their work to a file. You wouldn't need to save the images, just a path so you know where to find them

  5. #5
    Member
    Join Date
    Feb 2012
    Posts
    106
    My Mood
    Yeehaw
    Thanks
    8
    Thanked 11 Times in 11 Posts

    Default Re: Completely new to saving Data! need resources to read clear concepts.

    Okay, that is how i would have done it with out access to any of your minds, and reading it from your words it is starting to seem more reasonable.

    So I guess the only question that is left is how to protect this data from idiots?

    1) I don't mind the images/JPEGs being visible since the format will be windows friendly.
    but is there a way I can warn them not to delete, or change the name of the JPEG?

    2) I need my file as protected as possible! I have little experience formatting a load file, so the exception handling is already going to be a nightmare for me.
    Is there a way I can set my own 3 character file type?

    3) Even if I am able to save my file as my own type, I know its usually possible to open it with say note pad, is there a way I can lock it or make it invisible to the user?

    Thanks again copeg,
    Jonathan

  6. #6
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,372
    Thanks
    183
    Thanked 836 Times in 779 Posts
    Blog Entries
    5

    Default Re: Completely new to saving Data! need resources to read clear concepts.

    Quote Originally Posted by JonLane View Post
    Okay, that is how i would have done it with out access to any of your minds, and reading it from your words it is starting to seem more reasonable.

    So I guess the only question that is left is how to protect this data from idiots?
    Almost application out there has similar problems and they run fine 99.9% of the time when it comes to this. Not many take the risk of opening up a file made by their application and change it - they should inherently know the risks associated with doing this. One of the few ways to guard against this is to have a full blow enterprise application in which the data resides on a remote server that the user can only touch using your application (and hence can only communicate using the methods you've defined in your application)

    Quote Originally Posted by JonLane View Post
    1) I don't mind the images/JPEGs being visible since the format will be windows friendly.
    but is there a way I can warn them not to delete, or change the name of the JPEG?
    If they reside in the OS and they move things through the OS, then no. If something happens to the image, you can load the file, search for the images, and if one or more don't exist warn the user and ask them to define another image (this is assuming the user defines the images - if the application defines the images then you can wrap them within a jar along with your application)

    Quote Originally Posted by JonLane View Post
    2) I need my file as protected as possible! I have little experience formatting a load file, so the exception handling is already going to be a nightmare for me.
    Is there a way I can set my own 3 character file type?
    This is platform specific. Yes you can, but associating the extension to the app depends upon the OS

    Quote Originally Posted by JonLane View Post
    3) Even if I am able to save my file as my own type, I know its usually possible to open it with say note pad, is there a way I can lock it or make it invisible to the user?
    You can encrypt the file if you wish, but like I said above most users won't touch these files because there is absolutely no reason to.

  7. The Following User Says Thank You to copeg For This Useful Post:

    JonLane (February 28th, 2012)

  8. #7
    Member
    Join Date
    Feb 2012
    Posts
    106
    My Mood
    Yeehaw
    Thanks
    8
    Thanked 11 Times in 11 Posts

    Default Re: Completely new to saving Data! need resources to read clear concepts.

    Well, I have my weeks work cut out for me, thanks again copeg.

Similar Threads

  1. [SOLVED] I need help with saving state data.
    By JonLane in forum Collections and Generics
    Replies: 6
    Last Post: February 27th, 2012, 03:48 AM
  2. Saving the dialog box data
    By nrao in forum JavaServer Pages: JSP & JSTL
    Replies: 0
    Last Post: February 24th, 2011, 02:53 PM
  3. saving the data of the child jsp into parent jsp
    By nrao in forum JavaServer Pages: JSP & JSTL
    Replies: 0
    Last Post: January 15th, 2011, 11:05 AM
  4. saving list of data from JSP into java object
    By nrao in forum JavaServer Pages: JSP & JSTL
    Replies: 4
    Last Post: January 12th, 2011, 11:24 AM
  5. need help with saving data
    By bardd in forum Java Theory & Questions
    Replies: 5
    Last Post: September 19th, 2010, 03:33 PM