Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (109)
games submitted by our members
Games in WIP (536)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  using mySQL for data storage  (Read 1837 times)
0 Members and 1 Guest are viewing this topic.
Offline aran

Junior Newbie





« Posted 2005-08-17 03:01:40 »

I'm designing an american football management sim, it's going to be free and open-source (working title: Free Football Sim). It will be coded in java (of course Smiley). I need a big time data storage solution for all the stats and ratings that i'm going to be tracking (think scalability; 100 years of statistical information about thousands of players who have been on any of up to 40 teams). I know some SQL, so mySQL has popped into my mind as a very desirable tool.

Is there a way that i can set up a mySQL database using my game's installer  that won't have to run all the time? Perhaps a database with a small footprint that i can start up when i start the game and close when i close the game?

Any help would be much appreciated. Smiley
Offline oNyx

JGO Coder


Medals: 1


pixels! :x


« Reply #1 - Posted 2005-08-17 04:02:41 »

Check this one:
http://sourceforge.net/projects/hsqldb

弾幕 ☆ @mahonnaiseblog
Offline aran

Junior Newbie





« Reply #2 - Posted 2005-08-17 05:46:11 »

WOW! that looks like just what i want!

Although i'm not very experienced with databases not running on webservers, i can gather from the description of it that it's a small mySQL engine that is quite fast and can be run and closed without having to have some type of service up all the time?

I'm going to have to do some research about this, but thanks a lot!

Smiley
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Jeff

JGO Coder




Got any cats?


« Reply #3 - Posted 2005-08-17 10:02:06 »

WHy not go pure java?

http://db.apache.org/derby/

Got a question about Java and game programming?  Just new to the Java Game Development Community?  Try my FAQ.  Its likely you'll learn something!

http://wiki.java.net/bin/view/Games/JeffFAQ
Offline erikd

JGO Ninja


Medals: 16
Projects: 4
Exp: 14 years


Maximumisness


« Reply #4 - Posted 2005-08-17 10:53:36 »

WHy not go pure java?

http://db.apache.org/derby/

Derby looks interesting, but hsqldb (as oNyx suggested) is pure java too, no?

Offline blahblahblahh

JGO Coder


Medals: 1


http://t-machine.org


« Reply #5 - Posted 2005-08-17 12:20:05 »

I hope you have a source for the data Smiley. Most such databases are heavily guarded (because they represent huge time and effort), and in the UK they're protected by a specific law - it's illegal to use someone else's statistical data, you have to *prove* you went and read all the magazines / game-results by hand and compiled the entire DB by hand (IIRC the US doesn't have such a direct law, so it's looser, but similar sentiments exist covered by other laws). I'm guesisng you've got some free open DB that someone's compiled and makes available, but if not I'd suggest just making up your own data by random generation

malloc will be first against the wall when the revolution comes...
Offline cfmdobbie

Senior Member


Medals: 1


Who, me?


« Reply #6 - Posted 2005-08-18 15:00:51 »

Although i'm not very experienced with databases not running on webservers, i can gather from the description of it that it's a small mySQL engine that is quite fast and can be run and closed without having to have some type of service up all the time?

Just to be picky, it's a implementation of a SQL engine - MySQL's a different implementation, as is SQL Server, Oracle etc.

Yes, HSQLDB can be run in-memory very easily.  Try something like the following:

1  
2  
3  
4  
5  
6  
7  
8  
9  
   Class.forName("org.hsqldb.jdbcDriver" );
   // Open connection
  Connection c = DriverManager.getConnection("jdbc:hsqldb:mem:mydatabase", "sa", "");
    // Use database
  Statement s = c.createStatement();
   s.execute("CREATE TABLE users (username VARCHAR, password VARCHAR)");
   s.close();
   // Finish up
  c.close();


If you want to persist the database, use a connection string of the form "jdbc:hsqldb:file:/path/to/file" and I think you'll need to run an s.execute("SHUTDOWN") to clean up properly.

Hellomynameis Charlie Dobbie.
Offline Jeff

JGO Coder




Got any cats?


« Reply #7 - Posted 2005-08-19 02:04:47 »

AH, so it is (hsql is pure java.)

So hsql == hypersonic.

Derby == Cloudscape.

One difference I see is that I believe Derby is a complete SQL92 implementation.

Got a question about Java and game programming?  Just new to the Java Game Development Community?  Try my FAQ.  Its likely you'll learn something!

http://wiki.java.net/bin/view/Games/JeffFAQ
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

CogWheelz (14 views)
2014-08-01 22:53:16

CogWheelz (15 views)
2014-08-01 22:51:43

CopyableCougar4 (15 views)
2014-08-01 19:37:19

CogWheelz (19 views)
2014-07-30 21:08:39

Riven (27 views)
2014-07-29 18:09:19

Riven (16 views)
2014-07-29 18:08:52

Dwinin (14 views)
2014-07-29 10:59:34

E.R. Fleming (35 views)
2014-07-29 03:07:13

E.R. Fleming (13 views)
2014-07-29 03:06:25

pw (44 views)
2014-07-24 01:59:36
Resources for WIP games
by CogWheelz
2014-08-01 18:20:17

Resources for WIP games
by CogWheelz
2014-08-01 18:19:50

List of Learning Resources
by SilverTiger
2014-07-31 18:29:50

List of Learning Resources
by SilverTiger
2014-07-31 18:26:06

List of Learning Resources
by SilverTiger
2014-07-31 13:54:12

HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!