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