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 5 of 5

Thread: Java, Best way to store information?

  1. #1
    Member Emperor_Xyn's Avatar
    Join Date
    Dec 2011
    Posts
    66
    My Mood
    Devilish
    Thanks
    21
    Thanked 2 Times in 2 Posts

    Default Java, Best way to store information?

    Lets say I was to create a program, have a login, register database and everything. Now my question is what is the best way to store information even when the program ends. My old possibility I know is to read and write to a file. But I thought their has to be something more than just that.

    Right now, for tommorow I have JDBC i'm going to learn. Is that the answer to my problem? Or what other ways is there, and what's the best/most commonly used in a business invironement/freelancer.

    Please elaborate on the concept in general, going through all the possibilities to the advantages or disadvantages to each if you may.
    Last edited by Emperor_Xyn; December 22nd, 2011 at 03:12 AM.


  2. #2
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,424
    My Mood
    Hungover
    Thanks
    144
    Thanked 636 Times in 540 Posts

    Default Re: Java, Best way to store information?

    You're asking questions that aren't really answerable- it all depends on your exact context, what you're planning on doing in the long run, your current skill level, etc. Stop worrying about "the best way" to do things and just do them in a way that makes sense to you.

    That being said, if you have a login/registration database, can't you just use that? Or you could look into serialization or outputting xml or a simple text file. Or you could use save passcodes that get hashed to states somehow. There are probably many more options
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  3. The Following User Says Thank You to KevinWorkman For This Useful Post:

    Emperor_Xyn (December 22nd, 2011)

  4. #3
    Member Emperor_Xyn's Avatar
    Join Date
    Dec 2011
    Posts
    66
    My Mood
    Devilish
    Thanks
    21
    Thanked 2 Times in 2 Posts

    Default Re: Java, Best way to store information?

    Ok thanks, I wasn't too sure if their were more ways. But they must be alot more complex than I am.

    Should I stick to simple text file?? Will it be useful in the long run?

  5. #4
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,424
    My Mood
    Hungover
    Thanks
    144
    Thanked 636 Times in 540 Posts

    Default Re: Java, Best way to store information?

    Quote Originally Posted by Emperor_Xyn View Post
    Should I stick to simple text file?? Will it be useful in the long run?
    Like I said, that's completely up to you. If simple text files serve your purpose and fit into your brain, by all means go for it. You might also want to look into serialization though.
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  6. #5
    Member Emperor_Xyn's Avatar
    Join Date
    Dec 2011
    Posts
    66
    My Mood
    Devilish
    Thanks
    21
    Thanked 2 Times in 2 Posts

    Default Re: Java, Best way to store information?

    Thanks mate, I will google serialization now. I'm always up for learning something new.

Similar Threads

  1. Information on Java Mapobjects
    By rain_dew in forum Java Theory & Questions
    Replies: 3
    Last Post: September 16th, 2011, 03:31 PM
  2. How to Retrive Information about USB Disk through Java?
    By shatztal in forum Java Theory & Questions
    Replies: 5
    Last Post: July 18th, 2011, 11:05 AM
  3. can't get all the information out of my array at once... please help
    By Tate in forum What's Wrong With My Code?
    Replies: 3
    Last Post: November 28th, 2010, 06:22 AM
  4. How do I access SENS information in JAVA?
    By cabodge in forum Java Theory & Questions
    Replies: 4
    Last Post: March 9th, 2010, 06:52 PM
  5. Replies: 2
    Last Post: February 19th, 2010, 08:10 AM