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