How to save user inputed data on a java program

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • powerovergames
    New Member
    • Feb 2008
    • 2

    #1

    How to save user inputed data on a java program

    I wrote a simple gambling game using java, and I wish to let the user to save their record(i.e # of rounds played, points gained per round) so after quitting they game, they could keep on playing intead of starting all over again. Then this game could be more addictive. Can any one tell me how to do that?

    Also can you tell me how to run a .class file without running Jcreator?
  • nomad
    Recognized Expert Contributor
    • Mar 2007
    • 664

    #2
    Originally posted by powerovergames
    I wrote a simple gambling game using java, and I wish to let the user to save their record(i.e # of rounds played, points gained per round) so after quitting they game, they could keep on playing intead of starting all over again. Then this game could be more addictive. Can any one tell me how to do that?

    Also can you tell me how to run a .class file without running Jcreator?
    try looking into the Java Database Connectivity (JDBC)

    take a look at this link
    This JDBC Java tutorial describes how to use JDBC API to create, insert into, update, and query tables. You will also learn how to use simple and prepared statements, stored procedures and perform transactions


    nomad
    Last edited by nomad; Feb 28 '08, 01:10 AM. Reason: add link to java.sun.com

    Comment

    • powerovergames
      New Member
      • Feb 2008
      • 2

      #3
      Originally posted by nomad
      try looking into the Java Database Connectivity (JDBC)

      take a look at this link
      This JDBC Java tutorial describes how to use JDBC API to create, insert into, update, and query tables. You will also learn how to use simple and prepared statements, stored procedures and perform transactions


      nomad
      I will take a look a that, but it looks beyond my current knowledge level.

      Comment

      • BigDaddyLH
        Recognized Expert Top Contributor
        • Dec 2007
        • 1216

        #4
        A much simpler approach would be to write-to and later read-from a file:

        This Java tutorial describes exceptions, basic input/output, concurrency, regular expressions, and the platform environment


        Another approach that is suitable for a small amount of data, like user preferences, is to use java.util.prefs :

        Comment

        • sukatoa
          Contributor
          • Nov 2007
          • 539

          #5
          Also can you tell me how to run a .class file without running Jcreator?
          If you mean that having your compiled code in a executable like to run your program by just clicking on it, then you may need this.

          I hope it helps,
          Sukatoa

          Comment

          Working...