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
Thanks for the quick response. Do you really think that is the way to go? Are there any other options you know of? Not that I have a problem with your suggestion
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).
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/
Btw the MySQL connecter is pre-added into the bukkit/craftbukkit jars so no need for that library to be honest
Right, I can't believe I missed that. The resources secion is over here: http://forums.bukkit.org/threads/resources-index.33923/ Look under Database. I guess, skip the 1st tutorial. I think I like the last two tutorials best.