Storing/Reading an ItemStack from MySQL?

Discussion in 'Plugin Development' started by thebigdolphin1, Dec 26, 2012.

Thread Status:
Not open for further replies.
  1. I dont have any idea how to use MySQL, I dont even understand how it works.
    I want to save ALL the NBT Data, Enchantments, eg, with it, using preferably a string (Im not sure how this works! :D)
    Thanks.
    (Ill need EVERY bit of code to do this)
     
  2. tehbeard is that API?
    And if it is, does the server need the server version on?

    tehbeard it needs to be MySQL, as I need to transfer these files between 2 servers! :)

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 30, 2016
  3. The core part (the JDBC mysql driver) is part of the bukkit jar.

    As for SQLLibrary, I believe you roll it into your plugin. More specific questions on it are better answered in it's thread (I only have experience with using JDBC directly, not SQLLibrary)
     
  4. tehbeard well, I now need help reading/writing an itemstack in a string now
     
  5. YamlConfiguration config = new YamlConfiguration();


    ....

    //to save
    config.put("item",itemstackVariable);
    String itemstackAsString = config.saveToString();

    ....
    //to load
    config.load(itemstackAsString);//might be loadString()

    ItemStack is = (ItemStack)config.get("item")
     
  6. Offline

    BaumwolleHD

    Why not save the config to mysql?
     
Thread Status:
Not open for further replies.

Share This Page