org.jangband.db
Class DataStore

java.lang.Object
  extended by org.jangband.db.DataStore
All Implemented Interfaces:
org.picocontainer.Startable

public class DataStore
extends java.lang.Object
implements org.picocontainer.Startable

Creates the database connection to a standalone HSQLDB. The database is 'db/jangband'.

Provides methods for returning and storing data to the db. These methods could be split out later, but for now it is convenient to leave them hear.


Field Summary
private  java.sql.Connection conn
           
 
Constructor Summary
DataStore()
          Initializes the database connection so that other classes have access to game information.
 
Method Summary
 java.util.ArrayList<Gender> getGenders()
          Gets gender info from the genders table.
 java.util.ArrayList<PlayerRace> getPlayerRaces()
          Gets racial information from the player_races table.
private  boolean initConnection()
          Returns false if the connection fails.
 void start()
          Called by Pico Container.
 void stop()
          Called by Pico Container.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

conn

private java.sql.Connection conn
Constructor Detail

DataStore

public DataStore()
Initializes the database connection so that other classes have access to game information.

Method Detail

start

public void start()
Called by Pico Container.

Specified by:
start in interface org.picocontainer.Startable

stop

public void stop()
Called by Pico Container.

Specified by:
stop in interface org.picocontainer.Startable

initConnection

private boolean initConnection()
Returns false if the connection fails.

Returns:

getGenders

public java.util.ArrayList<Gender> getGenders()
Gets gender info from the genders table.


getPlayerRaces

public java.util.ArrayList<PlayerRace> getPlayerRaces()
Gets racial information from the player_races table.





SourceForge.net Logo

Server provided by Gene Davis Software.