Beispiel #1
0
 public static void initialize() {
   database = new SQLiteDB();
   try {
     database.load();
   } catch (Exception e) {
     Bukkit.getLogger().info("Error loading database!");
   }
 }
Beispiel #2
0
 public static void deleteAccount(String player) {
   String query = "delete from data where player = '" + player + "'";
   database.query(query);
 }
Beispiel #3
0
 public static void updateQuantity(String player, int quantity) {
   String query = "update data set quantity = " + quantity + " where player = '" + player + "'";
   database.query(query);
 }
Beispiel #4
0
 public static int getBalance(String player) {
   String query = "select quantity from data where player = '" + player + "'";
   return parseQueryToInt(database.query(query));
 }
Beispiel #5
0
 public static void openAccount(String player, int quantity) {
   String query = "insert into data(player,quantity) values('" + player + "'," + quantity + ")";
   database.query(query);
 }
Beispiel #6
0
 public static void close() {
   database.unload();
 }