Is there an SQL API?

Discussion in 'Plugin Development' started by Mtihc, Nov 11, 2011.

Thread Status:
Not open for further replies.
  1. I recently installed MySQL on my server.

    I'm not a total newb at developing plugins. And I think I'm ready to go a bit more advanced.

    Where do I get started using databases in my plugin?

    I know the possibilities and what to use it for.
    I would just like for someone to point me in the right direction, code-wise.

    Maybe there is some SQLDatabase object in java? Or does bukkit provide a way?

    Sorry if I missed a sticky about this :'(
     
  2. Offline

    Lolmewn

  3. In my opinion it's the easiest way of doing it.
     
    Mtihc likes this.
  4. Kay thnx, I like 2nd opinions, tee hee :p
     
  5. Offline

    se1by

    Does someone have a good tutorial for mysql in bukkit without an api?
    I would like to know how to do it when you dont have an api (outside bukkit).
     
  6. Offline

    Xandaros

    Bukkit has ebeans implemented.
    Use getServer().getDatabase() to get acces to the ebeans server.
    You have to put "database: true" in you bukkit.yml, btw.
    The user sets up their database in bukkit.yml, then. If the user does not do that, it will default to SQLite.
    Imo, this is very handy, as it has a default database and it is possible to use MySQL, as well.
    Also, this is implemented in bukkit already, so I think this is the way to go.

    There is a tutorial on this forums somewhere, I do not know where, though.

    I'll look for it.

    Edit:
    There you go: http://forums.bukkit.org/threads/persistence-databases-bukkit-tutorial.12404/
     
  7. Offline

    herghost

  8. Offline

    thehutch

    Btw the MySQL connecter is pre-added into the bukkit/craftbukkit jars so no need for that library to be honest :D
     
    Mtihc likes this.
  9. Offline

    Lolmewn

    Someone should make a how-to then, cuz I don't know how it works.
     
  10. Offline

    thehutch

    Check out the resources section or ask @cheese5505
     
  11. Offline

    cheese5505

    Wuzh?
     
  12. cheese5505 likes this.
  13. Offline

    Daniel Heppner

    It's advisable to avoid databases and use flatfiles unless you really need them.
     
  14. Offline

    cheese5505

Thread Status:
Not open for further replies.

Share This Page