Managing Your tXtFL Database

If you've checked out a tXtFL pre-release, you've probably noticed the new database for storing all the team and player information. We're really excited about the database because it provides a lot more potential for expanding the game. Our last pre-release included a way to keep track of seasons, and we have just added the ability to create new leagues, each with its own rule set.

Of course, a database is only as good as the ability to get data into and out of it. The tools included in tXtFL so far allow you to import player and team information from spreadsheets, but nothing more fancy. Fortunately there's another tool that you can use to access and update the database, from modification of individual player stats to addition of whole new teams and leagues. We'll take you through the setup to hook up with your database and make modifications.

There are a number of ways to access the database, but the way we recommend here is to use OpenOffice.org (OOo). The advantage of OOo is that the same program includes a spreadsheet editor for player and team spreadsheets, and the entire program is completely free (not to mention an awesome alternative to Microsoft Office). OOo runs on every platform on which tXtFL is supported (Windows, Mac, and even Linux).

Here are the steps to access your tXtFL database. It looks long, but once you've completed the steps once, you'll have a file that you can simply double-click to re-access the database.
  1. If you haven't already done so, download and install OpenOffice.org.
  2. Run OOo, open Tools > Options > Java.
  3. Click on Class Path > Add Archive. Select the file derby.jar, found in your tXtFL directory (e.g. Libraries\Documents\tXtFL-2.0.0alpha3-win\derby.jar). Press OK in the Class Path and Options windows. UPDATE: If you're using the Java Web Start download, you can grab the derby.jar file from the Derby website (the lib.zip file should suffice).
  4. Select File > New > Database.
  5. Choose "Connect to an existing database", select JDBC, and press Next.
  6. In the Datasource URL field, enter derby:C:\Users\[username]\.txtfl\FootballDB. Adjust the path to point to the copy of .txtfl\FootballDB on your computer. UPDATE: As of tXtFL 3, the .txtfl folder changed to .txtfl3, so the full path is  derby:C:\Users\[username]\.txtfl3\FootballDB.
  7. In the JDBC driver class field, enter org.apache.derby.jdbc.EmbeddedDriver, and press Next.
  8. Press Next again, as you do not need a username/password.
  9. Save the file with whatever name you like. This file will allow you to access the database without having to enter all of these steps again!
  10. Click on Tables on the left hand side, and start viewing/editing the database as you like.
  11. When you're done, don't forget to completely exit OOo, as tXtFL won't be able to connect to the database while OOo is still connected.
 Now you can tweak your team at will and micromanage every aspect of it...and just create every fancy league with the most exotic rule sets you can think of.

    Comments

    1. Jeff C8:23 AM

      I love the sim. Is there a way to assign a different "plays" table to each team?

      ReplyDelete
    2. Thanks! I haven't added that feature yet but am planning on it. It'd be nice to have a customizable playbook for each team.

      ReplyDelete
    3. Andreas1:57 AM

      Hi, this program is very interesting for a little project I have. However I'm not really so good at computers. Is it possible to get a DB walk through for a mac? All i get is a txtFL.app that seems not to contain a FootballDB. I'm a bit lost.
      Another question also; does the engine account for injuries at all?

      Thanks
      Andreas

      ReplyDelete
    4. Hi Andreas - thanks for asking! The FootballDB folder is created after first launching the game, and you can find it in the .txtfl folder in your home directory. On the Mac it won't show up in Finder because they normally hide the "dot" folders, but if you open a Finder window and then go to the menu entry, "Go > Go to folder...", you can type in ".txtfl", and it'll pop up into the Finder window.

      Regarding injuries, that's another feature I'll need to incorporate. It would certainly add to the sim!

      ReplyDelete
    5. Andreas1:13 PM

      Hi David and thanks for the fast reply, I found the file just where you said it would be. However, as I said I'm not good with computers and certainly not with Apple. Since the derby file is somehow "inside" the txtfl.app itself, I find myself physically hindered to give OO the path. Never mind. I have some mac friends to ask, i don´t expect you to help me with this. I'll just type this to let you know the DB tweaking in combination with a solid football sim is just awesome, and I let you know when I get in, this is gonna fun!

      ReplyDelete
    6. Hi Andreas - glad you found the file! To access the derby.jar file, you can right-click on the app file (eg tXtFL-2.0.0.app, from the .dmg file) and then choose Show Package Contents. From there the derby file can be found in Contents > MacOS > lib.

      If you downloaded the program by Java Web Start, the derby file gets placed somewhere else, but you can actually get it from the Derby site as well!

      ReplyDelete
    7. Happy to see the version 3 release! Unfortunately, I am having trouble with the database.

      I've simulated an entire season, but cannot access the database (or the stats, but that is a different topic)

      I am running Windows7. Downloaded the debry lib to get the derby.jar file.

      I have mapped to the database to C:\(nameofuser)\.txtfl\FootballDB

      However, I see nothing there. seg0 has a dat file and the other folder does as well.

      Something I am missing?

      ReplyDelete
    8. For tXtFL 3 the database is now in the .txtfl3 folder (instead of .txtfl). I'll need to update that in the instructions--thanks for pointing it out!

      I've been planning to make an easier interface for accessing stats once tXtFL 3 was out, so I'll be getting started on that soon. In the meantime, you can find the stats for each player in the Player_Game_Stats table.

      Let me know how it goes!

      ReplyDelete
    9. And actually for automated games, right now it doesn't record player stats (because of the 100,000s of games that might be run), though I could definitely provide an option for that or at least to output to a text file if you're interested.

      ReplyDelete
    10. I would like to output stats. An option to dump it out to a text file would be great!

      Part of what I like to do it write up reports of games based on the stats similar to little blurb I used to see in the newspaper.

      Is there anything I can do to help?

      ReplyDelete
    11. I can certainly add that option. I've been planning to have some sort of preferences pane for choosing and remembering these types of selections.

      It would be awesome to have you involved! Perhaps we could have your write-ups on the blog if you like. Let me know what kinds of things you might be interested in, and we can work it out.

      ReplyDelete
    12. To become an expert sales coordinator, high grades in your sales management course are mandatory. If you’re burdened with assignments, rely on the academic writing help service providers online. They will help you out. Apart from grades, you’ll also need unbeatable skills in client management, proficiency in query software, CRM and database user interface. Choose Myassignmenthelp.com.
      Academic essay writing has been a parameter to judge the merits of the students for a long time. The present time is none the less. In fact, as time is passing by, students are having more and more requirements to write an essay that will be graded. Hence seeking Do my essay online help is on the rise and it will be.

      ReplyDelete
    13. Use Finance assignment help to finish your finance or accounting papers without messing yourself. You will get assured solutions to your numerical questions within your defined date or time.
      Accounting assignment help

      ReplyDelete

    Post a Comment

    Popular Posts